def _add_arguments(cls, parser): from appr.commands.cli import get_parser, all_commands sub = parser.add_subparsers() install_cmd = sub.add_parser( 'install', help="Fetch the Chart and execute `helm install`", formatter_class=argparse.RawDescriptionHelpFormatter, description=helm_description( "install", "$ appr helm install quay.io/ant31/cookieapp -- --set imageTag=v0.4.5 --namespace demo" ), epilog="\nhelm options:\n See 'helm install --help'") upgrade_cmd = sub.add_parser( 'upgrade', help="Fetch the Chart and execute `helm upgrade`", formatter_class=argparse.RawDescriptionHelpFormatter, description=helm_description( "upgrade", "$ appr helm upgrade quay.io/ant31/cookieapp -- release-name --set foo=bar --set foo=newbar" ), epilog="\nhelm options:\n See 'helm upgrade --help'") dep_pull_cmd = sub.add_parser( 'dep', help="Download Charts from the requirements.yaml using app-registry" ) cls._init_dep_args(dep_pull_cmd) cls._init_args(install_cmd) cls._init_args(upgrade_cmd) install_cmd.set_defaults(func=cls._install) upgrade_cmd.set_defaults(func=cls._upgrade) dep_pull_cmd.set_defaults(func=cls._dep_pull) other_cmds = copy(all_commands()) other_cmds.pop("helm") get_parser(other_cmds, parser, sub, {'APPR_DEFAULT_MEDIA_TYPE': 'helm'})
def test_get_parser(): parser = get_parser(all_commands()) assert parser is not None
def cli_parser(): return get_parser(all_commands())