Skip to content

zonemaster-cli: disallow CLI options that do not make sense together #403

@marc-vanderwal

Description

@marc-vanderwal

There are combinations of command-line options to zonemaster-cli that do not make sense together, and should be rejected as usage errors.

Some examples:

  • A command line such as zonemaster-cli --help --list-tests --version --dump-profile doesn’t make sense at all, because all of these options select different modes. Any two of these options combined together should be rejected as an invalid command line.

  • In the synopsis, one line says zonemaster-cli [OPTIONS] --dump-profile. Because --dump-profile selects a different mode than the default one, there is just a small subset of OPTIONS that do make sense with --dump-profile. Which ones are acceptable, besides --profile=FILE? Combinations, such as the somewhat silly zonemaster-cli --dump-profile --no-json (because the --no-json applies to the output of zone testing and not profile dumps), should be rejected.

  • The error messages displayed on erroneous values for --level and --stop-level are inconsistent:

$ zonemaster-cli --stop-level=INVALID
Failed to recognize stop level 'INVALID'.
$ zonemaster-cli --level=INVALID
--level must be one of CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG, DEBUG2 or DEBUG3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-BugType: Bug in software or error in test case description

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions