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

Subcommand generate-schema with no arguments and with --help arguments throws #293

Closed
aj-stein-nist opened this issue Jan 18, 2024 · 1 comment · Fixed by #327
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aj-stein-nist
Copy link
Collaborator

Describe the bug

When using ad-hoc CLI testing to compare and contrast with the XSLT implementation today with @nikitawootten-nist, we determined there are consistency issues with the generate-schema subcommand of CLI as of commit 47a9687. It appears I had detected the issue given the current tests by "passing" the invocation of metaschema-cli generate-schema --help as returning ExitCode.INVALID_COMMAND, but did not realize this behavior is also exhibited running it metaschema-cli generate-schema , albeit it with different diagnostic messages for the similar commands. An updated repro branch for this bug report can be found via the URL below.

Who is the bug affecting?

Users of the metaschema-cli directly and/or using the nested oscal-cli metaschema ... subcommands.

What is affected by this bug?

Stability of using the help menu or running the subcommands without argument for installation tests interactively or scripting.

When does this occur?

Consistently.

How do we replicate the issue?

  1. Clone the repo and checkout the repro branch from the fork.
  2. Run mvn test on the CLI or via the command line.

Expected behavior (i.e. solution)

The CLI successful returns with ExitCode.OK and returns the help menu, it does not give error messaging about parameters arguments that would not be supplied when arguments are not provided, only the error message is displayed.

Other Comments

N/A

@aj-stein-nist aj-stein-nist added the bug Something isn't working label Jan 18, 2024
@aj-stein-nist aj-stein-nist self-assigned this Jan 18, 2024
aj-stein-nist added a commit to aj-stein-nist/metaschema-java that referenced this issue Jan 18, 2024
aj-stein-nist added a commit to aj-stein-nist/metaschema-java that referenced this issue Jan 26, 2024
@aj-stein-nist
Copy link
Collaborator Author

After reviewing test failures and reviewing gov.nist.secauto.metaschema.cli.processor.CLIProcessor.toOptions() and process command, I am going to likely need to implement Apache Commons CLI OptionGroups under the hood to resolve this issue.

Research: https://stackoverflow.com/a/36722157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants