macaron
macaron copied to clipboard
Enhance Macaron's command-line interface
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.,
-dused for bothanalyzeandverify-policyfor hash digest and database file, respectively.
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.,
-dused for bothanalyzeandverify-policyfor 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-fileflag inmacaron analyzeto--input-file. - [ ] Check for any required arguments that are not correctly marked as
required=Truein theargparseargument parser (raised in #200). - [ ] Display default values of arguments.
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.