Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #110634

RE: argparse and subparsers

From "Joseph L. Casale" <jcasale@activenetwerx.com>
Newsgroups comp.lang.python
Subject RE: argparse and subparsers
Date 2016-06-28 02:22 +0000
Message-ID <mailman.55.1467080552.2358.python-list@python.org> (permalink)
References <4ab10ce55d564780b158c19817009b62@activenetwerx.com> <mailman.11.1466967381.2358.python-list@python.org> <nkqbl0$tim$1@dont-email.me> <b7729720de9c4954a69063bd3933a603@activenetwerx.com>

Show all headers | View raw


> 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 --warning 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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

argparse and subparsers "Joseph L. Casale" <jcasale@activenetwerx.com> - 2016-06-26 18:51 +0000
  Re: argparse and subparsers Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-26 20:15 -0700
  Re: argparse and subparsers Sachin Garg <s.garg.computer@gmail.com> - 2016-06-27 00:55 -0400
    Re: argparse and subparsers Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-26 22:34 -0700
      Re: argparse and subparsers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-06-27 20:28 +1000
        Re: argparse and subparsers Sachin Garg <s.garg.computer@gmail.com> - 2016-06-27 13:22 -0400
          Re: argparse and subparsers Michele Simionato <michele.simionato@gmail.com> - 2016-06-28 03:02 -0700
    RE: argparse and subparsers "Joseph L. Casale" <jcasale@activenetwerx.com> - 2016-06-28 02:22 +0000

csiph-web