Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ethan Furman Newsgroups: comp.lang.python Subject: Re: What should Python apps do when asked to show help? Date: Thu, 28 Apr 2016 10:27:42 -0700 Lines: 24 Message-ID: References: <57223b76$0$22140$c3e8da3$5496439d@news.astraweb.com> <118360c7f0a4498e8ed35d6dd15b7ac0@seaexchmbx03.olympus.F5Net.com> <5722480E.7020102@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 6mLniRqRrCslzTAKtGVjAQbkUKj/OFaqgyqFksMXza8Q== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'subject:Python': 0.05; 'subject:help': 0.07; 'flags,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'suggest': 0.15; '--help': 0.16; '--verbose': 0.16; '--version': 0.16; 'argparse': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'scripts.': 0.16; 'subject:show': 0.16; 'subject:when': 0.16; 'wrote:': 0.16; 'handles': 0.20; 'parameter': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'header:User- Agent:1': 0.26; 'parameters': 0.27; 'package.': 0.27; 'dan': 0.29; '~ethan~': 0.29; 'url:python': 0.33; 'supports': 0.35; 'url:org': 0.36; 'created': 0.36; '(and': 0.36; 'url:library': 0.36; 'to:addr :python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'to:addr:python.org': 0.40; 'url:3': 0.60; 'charset:windows-1252': 0.62; 'p.s.': 0.65; 'python-list': 0.66; 'canon': 0.84; 'hand,': 0.97 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <118360c7f0a4498e8ed35d6dd15b7ac0@seaexchmbx03.olympus.F5Net.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5722480E.7020102@stoneleaf.us> X-Mailman-Original-References: <57223b76$0$22140$c3e8da3$5496439d@news.astraweb.com> <118360c7f0a4498e8ed35d6dd15b7ac0@seaexchmbx03.olympus.F5Net.com> Xref: csiph.com comp.lang.python:107812 On 04/28/2016 10:02 AM, Dan Strohl via Python-list wrote: > I would suggest using argparse https://docs.python.org/3/library/argparse.html as it handles all of that natively... On the other hand, if you feel that argparse is akin to using a canon to kill a mosquito, you can try scription*: - not argparse based - simple to use - supports flags, options, multioptions - supports --help (and -h if no other parameter uses that abbreviation) - supports --verbose (and -v of no other . . .) - supports --version - script parameters are global - (sub)command parameters are local -- ~Ethan~ * https://pypi.python.org/pypi/scription P.S. Yes, my package. ;) Created both for the learning, and because I feel like argparse is overpowered, complicated, and un-fun for scripts.