Method: pylint.config._pylint_config.help_message.get_subparser_help
Calls: 1, Exceptions: 0, Paths: 1Back
Path 1: 1 calls (1.0)
PyLinter (1)
'generate' (1)
'usage: pylint-config [options] generate [-h] [--interactive]\n\noptions:\n -h, --help show this help message and exit\n --interactive' (1)
1def get_subparser_help(linter: PyLinter, command: str) -> str:
2 """Get the help message for one of the subcommands."""
3 # Make sure subparsers are initialized properly
4 assert linter._arg_parser._subparsers
5 subparser_action = linter._arg_parser._subparsers._group_actions[0]
6 assert isinstance(subparser_action, argparse._SubParsersAction)
7
8 for name, subparser in subparser_action.choices.items():
9 assert isinstance(subparser, argparse.ArgumentParser)
10 if name == command:
11 # Remove last character which is an extra new line
12 return subparser.format_help()[:-1]
13 return "" # pragma: no cover