Skip to content

Use more standard practices with `--help` for provision script should be used

the --help is a bit confusing because there are optional and non-optional flags in the options section. all arguments in the options section should be option and all mandatory flags should be called out in the generic form at the top.

here's an example of what i mean:

provision - Provision a machine based on a configuration file.

Usage: provision [OPTIONS] -s DIRECTORY ACTION COMPONENT

Perform ACTION on COMPONENT, using specified options.
Omitting a component will result in ACTION being applied to all components
in the specified source.

Actions:

  install
    Installs specified component, or all if no component is given.

  update
    Updates specified component, or all if no component is given.

  help
    Prints this text.

  -s, --source [DIRECTORY]
    Path to a directory containing a file 'sources.list' along
    with any corresponding FOLDER type sources.

Options:

  -b, --backup
    Flag to enable processing of BACKUP-type entries in the 'sources.list'.

  -h, --help
    Print help text.

Examples:

  Install John Doe's website, using a 'sources.list' in his home folder.
    provision --source \"/home/john/provscripts\" install john-doe-website

  Update all components including running backups, using a 'sources.list' from Jane
  Doe's home folder.
    provision --backup --source \"/home/jane/provscripts\" update

Components must be from the list of configured items in 'sources.list'. More information
on composing a 'sources.list' can be found in the repository.