old_contents: import argparse
  
  
  class FullHelpAction(argparse._HelpAction):
      """Custom HelpAction to display help from all subparsers.
  
      This allows to have the help for all sub-commands when invoking:
      '<script.py> --help' rather than a somewhat incomplete help message only
      describing the name of the sub-commands.
      Note: taken from https://stackoverflow.com/a/24122778/2003420
      """
  
      def __call__(self, parser, namespace, values, option_string=None):
          # Print help for the parser this class is linked to
          parser.print_help()
          # Retrieve sub-parsers of the given parser
          subparsers_actions = [
              action
              for action in parser._actions
              if isinstance(action, argparse._SubParsersAction)
          ]
          for subparser_action in subparsers_actions:
              # Get all subparsers and print their help
              for choice, subparser in subparser_action.choices.items():
                  print("** Command '{}' **".format(choice))
                  print("{}\n".format(subparser.format_help()))
          parser.exit()
  
new_contents: import argparse
  from typing import Any, Optional, Sequence, Union
  
  
  class FullHelpAction(argparse._HelpAction):
      """Custom HelpAction to display help from all subparsers.
  
      This allows to have the help for all sub-commands when invoking:
      '<script.py> --help' rather than a somewhat incomplete help message only
      describing the name of the sub-commands.
      Note: taken from https://stackoverflow.com/a/24122778/2003420
      """
  
      def __call__(
          self,
          parser: argparse.ArgumentParser,
          namespace: argparse.Namespace,
          values: Union[str, Sequence[Any], None],
          option_string: Optional[str] = None,
      ):
          # Print help for the parser this class is linked to
          parser.print_help()
          # Retrieve sub-parsers of the given parser
          subparsers_actions = [
              action
              for action in parser._actions
              if isinstance(action, argparse._SubParsersAction)
          ]
          for subparser_action in subparsers_actions:
              # Get all subparsers and print their help
              for choice, subparser in subparser_action.choices.items():
                  print("** Command '{}' **".format(choice))
                  print("{}\n".format(subparser.format_help()))
          parser.exit()
  
subject: Add typing to HelpAction