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

fix_rules.py: Set subcommand required #7993

Merged

Conversation

ggbecker
Copy link
Member

Description:

  • fix_rules.py: Set subcommand required so it prints a nice message when there is no subcommand present in the command line.

Rationale:

  • Do not traceback when there is no subcommand, for example:
python3 utils/fix_rules.py
usage: fix_rules.py [-h] [-y] [-d] [-j JSON] [-r ROOT] [--product PRODUCT]
                    {empty_identifiers,empty_references,prefixed_identifiers,invalid_identifiers,int_identifiers,int_references,duplicate_subkeys,sort_subkeys,sort_prodtypes,add-cce} ...
fix_rules.py: error: the following arguments are required: {empty_identifiers,empty_references,prefixed_identifiers,invalid_identifiers,int_identifiers,int_references,duplicate_subkeys,sort_subkeys,sort_prodtypes,add-cce}

Before:

python3 utils/fix_rules.py
Traceback (most recent call last):
  File "/home/ggasparb/workspace/github/content/utils/fix_rules.py", line 808, in <module>
    __main__()
  File "/home/ggasparb/workspace/github/content/utils/fix_rules.py", line 804, in __main__
    args.func(args, subst_dict)
AttributeError: 'Namespace' object has no attribute 'func'

@ggbecker ggbecker added the bugfix Fixes to reported bugs. label Dec 13, 2021
@ggbecker ggbecker added this to the 0.1.60 milestone Dec 13, 2021
@jan-cerny jan-cerny self-assigned this Dec 13, 2021
@jan-cerny jan-cerny merged commit a1182a3 into ComplianceAsCode:master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes to reported bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants