Current thinking on required options

Chris Angelico rosuav at gmail.com
Mon Apr 19 14:21:16 EDT 2021


On Tue, Apr 20, 2021 at 4:18 AM Bill Campbell <bill at celestial.net> wrote:
>> On Mon, Apr 19, 2021, Loris Bennett wrote:
> >Hi,
> >
> >I have various small programs which tend to have an interface like the
> >following example:
> >
> > usage: grocli [-h] [-o {check,add,delete}] [-u USERS [USERS ...]] [-g GROUP]
>> I would do this with the action is first argument.
>> Usage: grocli check|add|delete [-u USERS ...]
>
Which aligns well with a concept of subcommands (or, in argparse
terms, subparsers).
ChrisA


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /