Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:: [': 0.04; 'syntax': 0.04; 'subject:group': 0.05; 'escribi\xc3\xb3:': 0.16; 'script?': 0.16; 'subject:argparse': 0.16; 'subject:options': 0.16; 'advance.': 0.19; 'subject:] ': 0.20; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'url:python': 0.33; 'subject:with': 0.35; 'received:google.com': 0.35; 'module.': 0.36; 'thanks': 0.36; 'possible': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'message-id:@gmail.com': 0.38; 'url:library': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'from:charset:utf-8': 0.61; 'exclusive': 0.81; 'groups:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=LqdnynoY/LkRSO2KYtMS5rmQn6NFyh4wotsQmDegNr0=; b=PEy8vRV2Ja5ApRHsbu2mnkxZIKT3cvx0ZiN1i1D73/hkTuSnEE5Jy63Fg8Yyc/avuh wEKWRE4RgNGkj2/lPMBtIMMrL8gVuyHDfhxq7loKCrrvwOjHxAYnqVXBEawHjqCe7wHR xzKupnDHhCpc64T0V94UzBWRTDzKQGO+1Fe5tfMCksJRRUfX1KRtBG9G1PcR9uFGZ7f6 80b8aiBxBcynpkNKdNKL2OMW1kHKk+K93sup2KXlA7pgIaBzd0Gj0WOTNA42ZThHyToC kCyPVG0Ho1W88Ht9bvx2P53f2Yw+m6+/wb7o53ucbB05WnrA+QW+1qJKuj8mLNRQ7Oux AEtg== X-Received: by 10.180.98.233 with SMTP id el9mr7776758wib.54.1375732885147; Mon, 05 Aug 2013 13:01:25 -0700 (PDT) Date: Mon, 05 Aug 2013 22:01:22 +0200 From: =?UTF-8?B?UmFmYWVsIER1csOhbiBDYXN0YcOxZWRh?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: python-list@python.org Subject: Re: [argparse] mutually exclusive group with 2 sets of options References: <51fdb81b$0$2423$426a74cc@news.free.fr> In-Reply-To: <51fdb81b$0$2423$426a74cc@news.free.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375732889 news.xs4all.nl 15936 [2001:888:2000:d::a6]:45231 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51977 El 04/08/13 04:10, Francois Lafont escribió: > Hi, > > Is it possible with argparse to have this syntax for a script? > > my-script (-a -b VALUE-B | -c -d VALUE-D) > > I would like to do this with the argparse module. > > Thanks in advance. > > I think you are looking for exclusive groups: http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_exclusive_group HTH