usnistgov/oscal-cli

The CLI expects the user to provide a non-implemented `--override` flag

nikitawootten-nist opened this issue · 2 comments

Describe the bug

When running operations such as profile resolve or <model> convert with an output file that already exists, the CLI complains that the file already exists, telling the user to run the command again with an --overwrite flag that has not been implemented.

Who is the bug affecting?

Users of the CLI

What is affected by this bug?

Any command that produces an output

When does this occur?

  • A command producing an output file is run with an existing file name
  • The CLI instructs the user to run again with --overwrite
  • The user reruns the command specifying --overwrite as instructed
  • --overwrite is treated as an unexpected option

How do we replicate the issue?

$ oscal-cli profile resolve /WORKING/basic-profile.json /WORKING/output-resolved-catalog.json
The provided destination '/WORKING/output-resolved-catalog.json' already exists and the --overwrite option was not provided.

$ oscal-cli profile resolve --overwrite /WORKING/basic-profile.json /WORKING/output-resolved-catalog.json
usage: oscal-cli profile resolve [<options>] <file to resolve> [<destination file>]
    --as <FORMAT>        source format: xml, json, or yaml
 -h,--help               display this help message
    --no-color           do not colorize output
 -q,--quiet              minimize output to include only errors
    --show-stack-trace   display the stack trace associated with an error
 -t,--to <FORMAT>        convert to format: xml, json, or yaml
    --version            display the application version

Expected behavior (i.e. solution)

Other Comments

Also of note in the expected behavior section the second run shows the help text because --overwrite is not an expected argument but does not report this. Following #125, an explicit error message should be added stating that an unexpected flag was provided.

This is a partial duplicate of #79.

This appears to be a dupe like Dave said, closing for now. If I misunderstood or there is not complete overlap, feel free to reopen this issue and let me know.