Hide deprecated CLI flags from `--help`.
@@ -149,18 +149,7 @@ def _print_support(ctx, param, value):
@click.option('--winrm-password', help='WINRM password.')
@click.option('--winrm-port', help='WINRM port to connect to.')
@click.option('--winrm-transport', help='WINRM transport for use.')
-# Eager commands (pyinfra [--facts | --operations | --support | --version])
-@click.option(
- '--facts', is_flag=True, is_eager=True, callback=_print_facts,
- help='Print available facts list and exit.',
-)
-@click.option(
- 'print_operations', '--operations',
- is_flag=True,
- is_eager=True,
- callback=_print_operations,
- help='Print available operations list and exit.',
-)
+# Eager commands (pyinfra --support)
@click.option(
'--support', is_flag=True, is_eager=True, callback=_print_support,
help='Print useful information for support and exit.',
@@ -174,10 +163,6 @@ def _print_support(ctx, param, value):
'--debug', is_flag=True, default=False,
help='Print debug info.',
)
-@click.option(
- '--debug-data', is_flag=True, default=False,
- help='Print host/group data before connecting and exit.',
-)
@click.option(
'--debug-facts', is_flag=True, default=False,
help='Print facts after generating operations and exit.',
@@ -252,6 +237,24 @@ def cli(*args, **kwargs):
disconnect_all(pseudo_state)
+if '--help' not in sys.argv:
+ click.option(
+ '--facts', is_flag=True, is_eager=True, callback=_print_facts,
+ help='Print available facts list and exit.',
+ )(cli)
+ click.option(
+ 'print_operations', '--operations',
+ is_flag=True,
+ is_eager=True,
+ callback=_print_operations,
+ help='Print available operations list and exit.',
+ )(cli)
+ click.option(
+ '--debug-data', is_flag=True, default=False,
+ help='Print host/group data before connecting and exit.',
+ )(cli)
+
+
def _main(
inventory, operations, verbosity,
user, port, key, key_password, password,
