We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5ae43a commit 7704408Copy full SHA for 7704408
detect_secrets/core/usage.py
@@ -104,14 +104,14 @@ def get_parser_to_add_opt_out_options_to(parser):
104
:rtype: argparse.ArgumentParser
105
:returns: argparse.ArgumentParser to pass into PluginOptions
106
"""
107
- if parser.prog == 'detect-secrets-hook':
108
- return parser
109
-
110
for action in parser._actions: # pragma: no cover (Always returns)
111
if isinstance(action, argparse._SubParsersAction):
112
for subparser in action.choices.values():
113
if subparser.prog.endswith('scan'):
114
return subparser
+ # Assume it is the 'detect-secrets-hook' console script
+ # Relying on parser.prog is too brittle
+ return parser
115
116
117
class ParserBuilder:
0 commit comments