Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert help subcommand throws an error, requires --to argument #210

Open
aj-stein-nist opened this issue Oct 19, 2023 · 1 comment
Open
Labels
bug Something isn't working devex java Pull requests that update Java code
Milestone

Comments

@aj-stein-nist
Copy link
Collaborator

Describe the bug

When updating integration tests for #178, I was attempting to write some smoke tests of the subcommand. The model validate -h command will successfully complete without error (e.g. ExitCode.OK status). On the other hand model convert -h will fail (e.g. ExitCode.INVALID_COMMAND) with an error message after the help menu, while adding tests off of 134d077.

Who is the bug affecting?

Developers wanting to run or test the oscal-cli programmatically.

What is affected by this bug?

Using the help menus on conversion or validation subcommands to ensure the application is properly installed and inspect the error code to be 0 before running more complex operations.

When does this occur?

Consistently.

How do we replicate the issue?

{What are the steps to reproduce the behavior?

  1. Write tests or run the commands like so with a build off of develop with the commit above or newer.
$ oscal-cli ap validate --help
usage: oscal-cli ap validate [<options>] <file to validate>
    --as=<FORMAT>        source format: xml, json, or yaml
 -c <FILE>               additional constraint definitions
 -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
    --version            display the application version
$ echo $?
0
$ oscal-cli ap convert --help
usage: oscal-cli ap convert --to=FORMAT [<options>] <source file> [<destination file>]
 -h,--help               display this help message
    --no-color           do not colorize output
    --overwrite          overwrite the destination if it exists
 -q,--quiet              minimize output to include only errors
    --show-stack-trace   display the stack trace associated with an error
    --to=<FORMAT>        convert to format: xml, json, or yaml
    --version            display the application version
Missing required option: to
$ echo $?
3

If applicable, add screenshots to help explain your problem.}

Expected behavior (i.e. solution)

{A clear and concise description of what you expected to happen.}

Other Comments

{Add any other context about the problem here.}

@aj-stein-nist aj-stein-nist added bug Something isn't working java Pull requests that update Java code devex labels Oct 19, 2023
@aj-stein-nist
Copy link
Collaborator Author

aj-stein-nist commented Jan 31, 2024

Similar issue as usnistgov/metaschema-java#293 (comment), but this is for a primary oscal-cli command and not a "wrapped" metaschema-cli command, will need to be resolved within this code base.

@aj-stein-nist aj-stein-nist modified the milestones: Future, Next Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devex java Pull requests that update Java code
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant