| 270 | |
| 271 | |
| 272 | def exit_with_help_message(parser): |
| 273 | print(green("To execute a prompt with a specified execution type", ['bold'])) |
| 274 | # retrieve subparsers from parser |
| 275 | subparsers_actions = [ |
| 276 | action for action in parser._actions |
| 277 | if isinstance(action, argparse._SubParsersAction)] |
| 278 | # there will probably only be one subparser_action, |
| 279 | # but better save than sorry |
| 280 | for subparsers_action in subparsers_actions: |
| 281 | # get all subparsers and print help |
| 282 | for choice, subparser in subparsers_action.choices.items(): |
| 283 | print(subparser.format_help()) |
| 284 | |
| 285 | print(green("To perform other Gorilla-x operations", ['bold'])) |
| 286 | parser.print_help() |
| 287 | |
| 288 | parser.exit() |
| 289 | |
| 290 | class _HelpAction(argparse._HelpAction): |
| 291 | |