Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Joseph L. Casale" Newsgroups: comp.lang.python Subject: RE: argparse and subparsers Date: Tue, 28 Jun 2016 02:22:19 +0000 Lines: 22 Message-ID: References: <4ab10ce55d564780b158c19817009b62@activenetwerx.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de Qv/9QElku2DFO7dVOqZejQrA5sGO4P04nRvmLSv+4MbQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'keyed': 0.09; 'bug': 0.10; 'argparse': 0.16; 'argument.': 0.16; 'debated': 0.16; 'dictionary,': 0.16; 'etc...': 0.16; 'fits': 0.16; 'received:172.18.0': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:argparse': 0.16; 'duplicate': 0.18; 'to:name :python-list@python.org': 0.20; 'tracker': 0.20; 'arguments': 0.22; 'seems': 0.23; 'passing': 0.23; 'thanks,': 0.24; 'header:In- Reply-To:1': 0.24; "doesn't": 0.26; 'sense': 0.26; 'parameters': 0.27; 'values': 0.28; 'interface': 0.29; 'foo': 0.33; 'clear': 0.35; 'but': 0.36; 'project': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'itself': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.40; 'easy': 0.60; 'eye': 0.61; 'perspective.': 0.84 X-Authority-Analysis: v=2.2 cv=QZUkhYTv c=1 sm=1 tr=0 a=g3mLq75WYuDrh3Lt0JSDww==:117 a=g3mLq75WYuDrh3Lt0JSDww==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=kHgwhut6nYtv92KsJEUA:9 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.activenetwerx.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 Thread-Topic: argparse and subparsers Thread-Index: AdHP2gSoxuCFxHcPRWiE5r3lwpEgMgAVxXoWACyPgkA= In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.0.200] X-CMAE-Envelope: MS4wfJS68wxW+BZemZxN6TzigX+NYkFeqFxBdE2dJMeLFXZlR3CPupYko2tbSOiqdcMsiT5m8LQFMZ7dHuj8lBHjPr8g6eCltebobt+lfjl65k9W3S/h0Tbf yRf5wvkv5yaOgulGHKGkLH8ggRDY2LBXvJIKgYftkfv/unKYhV3UZicAAxwqYg3q0J771b3hkjvYPw== 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: X-Mailman-Original-References: <4ab10ce55d564780b158c19817009b62@activenetwerx.com> Xref: csiph.com comp.lang.python:110634 > Not sure if this fits the bill, or makes sense here, but I came cross > "docopt" which touts itself as a "Command-line interface description > language". I used it in a project and it seems to be pretty easy to use > as well as elegant. It stores the arguments & values as a dictionary, > keyed by the argument. Yea I have had my eye on docopt for a while, it doesn't support multiple subparsers, as I am passing duplicate parameters from its perspective. Imagine: foo.py --host 172.18.0.4 --port 766 foo --warning 42 --critical 77 bar --wa= rning 4.2 --critical 7.7 etc... The shortcoming to argparse has been debated to death and the bug tracker was just left hanging. To be honest, I am not clear on the opposition to it= ... Thanks, jlc