Fix convert help subcommand error for #210#311
Open
heathdutton wants to merge 1 commit intousnistgov:developfrom
Open
Fix convert help subcommand error for #210#311heathdutton wants to merge 1 commit intousnistgov:developfrom
heathdutton wants to merge 1 commit intousnistgov:developfrom
Conversation
|
Thank you, @heathdutton. @selenaxiao-nist - please review the PR when you have a chance. |
selenaxiao-nist
requested changes
Dec 30, 2025
selenaxiao-nist
left a comment
There was a problem hiding this comment.
@heathdutton
Thanks for your contribution. This removes the error when running oscal-cli catalog convert --help but prints the error twice when running oscal-cli catalog convert
Please revise.
325ca86 to
ed83b63
Compare
selenaxiao-nist
approved these changes
Dec 30, 2025
selenaxiao-nist
left a comment
There was a problem hiding this comment.
The error is still printed twice, but after more testing I found this also happens with other subcommands, and isn't directly caused by these new changes. LGTM otherwise. I'll approve this PR and open a new issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Committer Notes
Closes #210.
The convert subcommand was throwing an error when invoked with --help, instead of displaying the help message and returning exit code 0. This occurred because the parent class marked the --to option as required, causing parsing to fail before help could be displayed.
This fix overrides gatherOptions() to define the --to option without marking it as required, and implements validateOptions() to skip validation when --help or --version is present. For normal convert operations, --to is still validated manually to ensure it's provided.
All Submissions:
Changes to Core Features:
Have you included examples of how to use your new feature(s)?N/AHave you updated all website and readme documentation affected by the changes you made?N/A