-
Notifications
You must be signed in to change notification settings - Fork 14
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
New command-line interface (options) #181
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexios Zavras (zvr) <[email protected]>
I will wait before merging this, to give a chance to update the workflows in other repos. |
@zvr - Should we start tagging releases for the spec parser? That way we can update the CI's to reference the tag and not worry about breaking them when we update the spec parser. The other advantage is that the change to update the version in the CI will trigger the CI and test out the changes before unrelated merges happen. To implement this suggestion:
|
The new command line looks great. Thank you @zvr Also agrees with @goneall suggestions on versioning/tagging. Workflows to be updated (in different branches, may including
|
@bact On the workflows:
|
I disagree on the tagging, especially if combined with the understanding that "tags are immutable". There is no plan to support more than one (the latest) version of spec-parser. So, any changes/enhancements/bug fixes will only be done in a sequential linear way, on a single branch. I mean, if we decide that "superclasses" output need to be changed (cf. spdx/spdx-3-model#960) the changes will only be applied to the latest version (for example, the one with the updated CLI options, if it has been merged). Therefore we should really discourage use of older versions. Giving "version" tags is helpful when the "API" changes in an incompatible way, so that callers can still use the old one (as Gary described). But this is not happening "often" (or ever). This change on this PR is the only such change in the last two years and I have announced it... a year(?) ago. On the other hand, there will be changes in the functionality (for example, generating the web pages to point the RDF endpoints to), without change in the calling API. Having an immutable tag on a version prevents users from getting the latest enhancements/fixes for this. There will be more API changes coming (e.g. including an option to specify which languages should be handled, when multi-language input is available), but my plan is to have all these changes made in a backwards compatible manner -- that's why I took so long to design and implement the system in this PR. In the end, if any script/automation really needs to use a specific instance of spec-parser, it can always use the corresponding commit-id. |
Do we like to have
|
parser = argparse.ArgumentParser(description="Generate documentation from an SPDXv3 model.") | ||
|
||
parser.add_argument("input_dir", type=str, help="Path to the input 'model' directory.") | ||
|
||
parser.add_argument("-d", "--debug", action="store_true", help="Print debug output") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser.add_argument("-d", "--debug", action="store_true", help="Print debug output") | |
parser.add_argument("-d", "--debug", action="store_true", help="Print spec-parser debug information.") |
To tell that this will be more verbose than --verbose
To tell that this is for spec-parser debugging purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, debug is not "more than verbose". It's a completely different functionality.
I agree that the current implementation with logging levels, DEBUG is a superset of INFO, but this might not stay the same way, once more messages get added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I have update the description accordingly.
No, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put in help description to specifically say that --debug
is for the debug of spec-parser (not the debug of the Markdown spec file) as described by the author in the comment section.
General stylistic suggestions. No need to change if feel unnecessary.
parser = argparse.ArgumentParser(description="Generate documentation from an SPDXv3 model.") | ||
|
||
parser.add_argument("input_dir", type=str, help="Path to the input 'model' directory.") | ||
|
||
parser.add_argument("-d", "--debug", action="store_true", help="Print debug output") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I have update the description accordingly.
parser.add_argument("-r", "--generate-rdf", action="store_true", help="Generate RDF output.") | ||
parser.add_argument("-R", "--output-rdf", type=str, help="Output directory for RDF files.") | ||
parser.add_argument("-t", "--generate-tex", action="store_true", help="Generate TeX output.") | ||
parser.add_argument("-T", "--output-tex", type=str, help="Output directory for TeX files.") | ||
parser.add_argument("-v", "--verbose", action="store_true", help="Print verbose output") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser.add_argument("-v", "--verbose", action="store_true", help="Print verbose output") | |
parser.add_argument("-v", "--verbose", action="store_true", help="Print verbose information.") |
Other descriptions have a fullstop.
parser.add_argument("-m", "--generate-mkdocs", action="store_true", help="Generate mkdocs output.") | ||
parser.add_argument("-M", "--output-mkdocs", type=str, help="Output directory for mkdocs files.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser.add_argument("-m", "--generate-mkdocs", action="store_true", help="Generate mkdocs output.") | |
parser.add_argument("-M", "--output-mkdocs", type=str, help="Output directory for mkdocs files.") | |
parser.add_argument("-m", "--generate-mkdocs", action="store_true", help="Generate MkDocs output.") | |
parser.add_argument("-M", "--output-mkdocs", type=str, help="Output directory for MkDocs files.") |
Keep the stylistic cases. Similar to PlantUML and TeX.
-m, --generate-mkdocs Generate mkdocs output. | ||
-M, --output-mkdocs OUTPUT_MKDOCS Output directory for mkdocs files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-m, --generate-mkdocs Generate mkdocs output. | |
-M, --output-mkdocs OUTPUT_MKDOCS Output directory for mkdocs files. | |
-m, --generate-mkdocs Generate MkDocs output. | |
-M, --output-mkdocs OUTPUT_MKDOCS Output directory for MkDocs files. |
Keep the original casing. Similar to PlantUML and TeX.
-h, --help Show this help message and exit | ||
-d, --debug Print debug output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-h, --help Show this help message and exit | |
-d, --debug Print debug output | |
-h, --help Show this help message and exit. | |
-d, --debug Print spec-parser debug information. |
Keep consistent with other descriptions that have a fullstop.
-R, --output-rdf OUTPUT_RDF Output directory for RDF files. | ||
-t, --generate-tex Generate TeX output. | ||
-T, --output-tex OUTPUT_TEX Output directory for TeX files. | ||
-v, --verbose Print verbose output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-v, --verbose Print verbose output | |
-v, --verbose Print verbose information. |
Keep consistent with other descriptions that have a fullstop.
Btw, in the option descriptions, we have two kinds of "output".
I suggest that we change the descriptions of --debug and --verbose to use the word "information" (or "log", etc) instead of "output" to clearly differentiate the two. |
This (finally) adds the brand new CLI.
It introduces a number of new command-line options, and essentially re-implements the top-level code of spec-parser.
As can be seen in the updated README, one can now call and only generate what is required -- or nothing at all, if only input validation is needed.
Fixes #152
Closes #161
Closes #179