def AddParser(
    provider: str,
    # pylint: disable=protected-access
    provider_parser: argparse._SubParsersAction,  # type: ignore
    # pylint: enable=protected-access
    func: str,
    func_helper: str,
    args: Optional[List[Tuple[str, str, Optional[Any]]]] = None) -> None:
  """Create a new parser object for a provider's functionality.

  Args:
    provider (str): The cloud provider offering the function. This should be
        one of ['aws', 'gcp'].
    provider_parser (_SubParsersAction): A provider's subparser object from
        argparse.ArgumentParser.
    func (str): The name of the function to look for in the given provider
        and to add parsing options for.
    func_helper (str): A helper text describing what the function does.
    args (List[Tuple]): Optional. A list of arguments to add
        to the parser. Each argument is a tuple containing the action (str) to
        add to the parser, a helper text (str), and a default value (Any or
        None).

  Raises:
    NotImplementedError: If the requested provider or function is not
        implemented.
  """
  if provider not in PROVIDER_TO_FUNC:
    raise NotImplementedError('Requested provider is not implemented')
  if func not in PROVIDER_TO_FUNC[provider]:
    raise NotImplementedError('Requested functionality {0:s} is not '
                              'implemented for provider {1:s}'.format(
                                  func, provider))
  func_parser = provider_parser.add_parser(func, help=func_helper)
  if args:
    for argument, helper_text, default_value in args:
      kwargs = {'help': helper_text}  # type: Dict[str, Any]
      if isinstance(default_value, bool):
        kwargs['action'] = 'store_true'
      else:
        kwargs['default'] = default_value
      func_parser.add_argument(argument, **kwargs)  # type: ignore
  func_parser.set_defaults(func=PROVIDER_TO_FUNC[provider][func])
Create a new parser object for a provider's functionality.

Args:
provider (str): The cloud provider offering the function. This should be
one of ['aws', 'gcp'].
provider_parser (_SubParsersAction): A provider's subparser object from
argparse.ArgumentParser.
func (str): The name of the function to look for in the given provider
and to add parsing options for.
func_helper (str): A helper text describing what the function does.
args (List[Tuple]): Optional. A list of arguments to add
to the parser. Each argument is a tuple containing the action (str) to
add to the parser, a helper text (str), and a default value (Any or
None).

Raises:
NotImplementedError: If the requested provider or function is not
implemented.
tools/cli.py