macaron icon indicating copy to clipboard operation
macaron copied to clipboard

Enhance Macaron's command-line interface

Open behnazh-w opened this issue 2 years ago • 2 comments

We need to revisit the cmd arguments in the CLI and Docker run script:

  • [ ] make sure the arguments are only required for the relevant sub-commands
  • [ ] add description for each sub-command
  • [ ] don't use same flag in two sub-commands, e.g., -d used for both analyze and verify-policy for hash digest and database file, respectively.

behnazh-w avatar May 10 '23 05:05 behnazh-w

After our discussion, I think we can update the list as follows:

  • [ ] Add help/description for each sub-command.
  • [ ] Make sure not to use the same flags for two sub-commands, e.g., -d used for both analyze and verify-policy for hash digest and database file, respectively. This can be avoided by not allowing short form altogether for certain flags.
  • [ ] Keep only a few top-level flags (e.g. --help/-h, --verbose/-v, --version/-V) and move everything else into the sub-commands. Repeating the same flag for two subcommands is preferred to keeping it at the top-level.
  • [ ] Revise the name of flags. This includes avoid using the word "path" (e.g. --repo-path, --sbom-path, --config-path, --template-path) -- "dir" or "file" should be preferred.
  • [ ] Rename the --config-file flag in macaron analyze to --input-file.
  • [ ] Check for any required arguments that are not correctly marked as required=True in the argparse argument parser (raised in #200).
  • [ ] Display default values of arguments.

nathanwn avatar May 30 '23 05:05 nathanwn

I like most of the points in https://github.com/oracle/macaron/issues/211#issuecomment-1567769670, but I'm not sure that including -file is useful, wouldn't --repo or --config or --input be perfectly reasonable without an additional -file suffix? It isn't like you're going to support strings for values.

jsoref avatar Jan 21 '24 09:01 jsoref