in hydra/_internal/utils.py [0:0]
def get_args_parser() -> argparse.ArgumentParser:
from .. import __version__
parser = argparse.ArgumentParser(add_help=False, description="Hydra")
parser.add_argument("--help", "-h", action="store_true", help="Application's help")
parser.add_argument("--hydra-help", action="store_true", help="Hydra's help")
parser.add_argument(
"--version",
action="version",
help="Show Hydra's version and exit",
version=f"Hydra {__version__}",
)
parser.add_argument(
"overrides",
nargs="*",
help="Any key=value arguments to override config values (use dots for.nested=overrides)",
)
parser.add_argument(
"--cfg",
"-c",
choices=["job", "hydra", "all"],
help="Show config instead of running [job|hydra|all]",
)
parser.add_argument(
"--resolve",
action="store_true",
help="Used in conjunction with --cfg, resolve config interpolations before printing.",
)
parser.add_argument("--package", "-p", help="Config package to show")
parser.add_argument("--run", "-r", action="store_true", help="Run a job")
parser.add_argument(
"--multirun",
"-m",
action="store_true",
help="Run multiple jobs with the configured launcher and sweeper",
)
# defer building the completion help string until we actually need to render it
class LazyCompletionHelp:
def __repr__(self) -> str:
return f"Install or Uninstall shell completion:\n{_get_completion_help()}"
parser.add_argument(
"--shell-completion",
"-sc",
action="store_true",
help=LazyCompletionHelp(), # type: ignore
)
parser.add_argument(
"--config-path",
"-cp",
help="""Overrides the config_path specified in hydra.main().