Skip to content

Commit ebec639

Browse files
authored
Support -h help option for user friendliness / best practices (#700)
Thank you @GHPS!
2 parents 185eb4d + 7adbadc commit ebec639

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/test_cli.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,18 @@ def test_import(cli_args, monkeypatch):
761761
assert 'tmuxinator' in result.output
762762
assert 'teamocil' in result.output
763763

764+
@pytest.mark.parametrize(
765+
"cli_args",
766+
[
767+
(['--help']),
768+
(['-h']),
769+
],
770+
)
771+
def test_help(cli_args, monkeypatch):
772+
runner = CliRunner()
773+
774+
result = runner.invoke(cli.cli, cli_args)
775+
assert 'Usage: cli [OPTIONS] COMMAND [ARGS]...' in result.output
764776

765777
@pytest.mark.parametrize(
766778
"cli_args,inputs",

tmuxp/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ def load_workspace(
749749
return _setup_plugins(builder)
750750

751751

752-
@click.group(context_settings={'obj': {}})
752+
@click.group(context_settings={'obj': {}, 'help_option_names':['-h', '--help']})
753753
@click.version_option(__version__, '-V', '--version', message='%(prog)s %(version)s')
754754
@click.option(
755755
'--log-level',

0 commit comments

Comments
 (0)