-
Notifications
You must be signed in to change notification settings - Fork 3
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
Polish modules arguments #10
Conversation
evgenyz
commented
Jun 18, 2024
- All modules inherit global options (input, tailoring).
- Some modules now share profile option.
- Added missing help text, metavars and titles.
compliance_tool/cli.py
Outdated
parser.set_defaults(func=list.execute) | ||
def prepare_parser_list(cli_sub_parsers, global_parser, profile_parser) -> None: | ||
parser = cli_sub_parsers.add_parser("list", parents=[global_parser], | ||
help="list available components") |
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.
It should list available security profiles and their identifiers.
Moreover, nobody knows what a "component" means.
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.
I've expanded the message a bit.
compliance_tool/cli.py
Outdated
parser.add_argument("--html") | ||
parser.add_argument("--json") | ||
parser.add_argument("--control", metavar="CONTROL_ID", | ||
help="control identifier") |
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.
The help text is very short here. It isn't clear what will happen if a user provides this argument. We need to explain in the help text what would happen if the user provides this argument.
Also, please foresee that we will use the help text to generate manual and or docs.
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.
Expanded it a bit. I would expect us to add more details following implementation of these features.
compliance_tool/cli.py
Outdated
parser.add_argument("--control", metavar="CONTROL_ID", | ||
help="control identifier") | ||
parser.add_argument("--rule", metavar="RULE_ID", | ||
help="rule identifier") |
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.
Ditto. We need to give an explanation on action will this option trigger in the help text.
compliance_tool/cli.py
Outdated
parser.add_argument("--control", metavar="CONTROL_ID", | ||
help="control identifier") | ||
parser.add_argument("--rule", metavar="RULE_ID", | ||
help="rule identifier") |
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.
These 2 have similar problem with lack of information in help text as in the other module.
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.
Expanded it a bit.
b4c07d2
to
d04bc40
Compare
compliance_tool/cli.py
Outdated
help="policy definitions (recognized formats: SCAP Data Stream)") | ||
global_parser.add_argument("--tailoring", metavar="SOURCE_FILE", | ||
help="policy customizations" | ||
" (recognized formats: XCCDF Tailoring, JSON Tailoring)") |
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.
It won't consume XCCDF tailoring. The whole point of the tool is to hide XCCDF and other SCAP technologies from the user, so that in future we can easily switch to other non-SCAP technologies.
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.
Do you think that we should somehow hint what format this should be in?
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.
Yes, definitely, we should.
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.
XCCDF Tailoring is gone.
compliance_tool/cli.py
Outdated
return parser | ||
global_parser = argparse.ArgumentParser(add_help=False) | ||
global_parser.add_argument("--input", metavar="SOURCE_FILE", | ||
help="policy definitions (recognized formats: SCAP Data Stream)") |
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.
It shouldn't depend on a SCAP data stream because we want to leave our door open to other technologies in future. We want the tool to be generic and not depend on SCAP technologies. The design that doesn't involve SCAP will allow us to easily switch to whatever technology we would use in the future.
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.
Do you think that we should somehow hint what format this should be in?
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.
Yes, I agree.
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.
The option is no longer there.
All modules inherit global options (input, tailoring). Some modules now share profile argument. Profile argument is mandatory now. Added missing help text, metavars and titles.
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.
amazing