Current thinking on required options

Gisle Vanem gisle.vanem at gmail.com
Mon Apr 19 07:16:52 EDT 2021


Loris Bennett wrote:

>    usage: grocli [-h] [-o {check,add,delete}] [-u USERS [USERS ...]] [-g GROUP]
> 
>    Command line grouper tool
> 
>    optional arguments:
>      -h, --help            show this help message and exit
>      -o {check,add,delete}, --operation {check,add,delete}
>                            operation to apply
>      -u USERS [USERS ...], --users USERS [USERS ...]
>                            users to apply operation to
>      -g GROUP, --group GROUP
>                            group to apply operation to
> 
> However, the options -o, -u, and -g are required, not optional.

Just a nitpick.

To quote from https://en.wikipedia.org/wiki/Usage_message
"To indicate required arguments, Angled brackets are
   commonly used, ..."

So then it should better be written as:
   grocli [-h] <-o {check,add,delete}> <-u USERS [USERS ...]> <-g GROUP>

-- 
--gv


More information about the Python-list mailing list