File tree Expand file tree Collapse file tree
src/pysonar_scanner/configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424from pysonar_scanner .exceptions import UnexpectedCliArgument
2525
2626
27+ class PyScannerHelpFormatter (argparse .HelpFormatter ):
28+ recommended_args = {"help" , "token" , "sonar_project_key" }
29+
30+ def _format_actions_usage (self , actions , groups ):
31+ filtered_actions = [action for action in actions if action .dest in PyScannerHelpFormatter .recommended_args ]
32+ return super ()._format_actions_usage (filtered_actions , groups )
33+
34+
2735class CliConfigurationLoader :
2836
2937 @classmethod
@@ -59,6 +67,7 @@ def __create_parser(cls):
5967 parser = argparse .ArgumentParser (
6068 description = "Sonar scanner CLI for Python" ,
6169 epilog = "Analysis properties not listed here will also be accepted, as long as they start with the -D prefix." ,
70+ formatter_class = PyScannerHelpFormatter ,
6271 )
6372
6473 parser .add_argument (
You can’t perform that action at this time.
0 commit comments