8000 Support -h help option to add user friendliness (and follow the de-facto standard) by GHPS · Pull Request #700 · tmux-python/tmuxp · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,18 @@ def test_import(cli_args, monkeypatch):
assert 'tmuxinator' in result.output
assert 'teamocil' in result.output

@pytest.mark.parametrize(
"cli_args",
[
(['--help']),
(['-h']),
],
)
def test_help(cli_args, monkeypatch):
runner = CliRunner()

result = runner.invoke(cli.cli, cli_args)
assert 'Usage: cli [OPTIONS] COMMAND [ARGS]...' in result.output

@pytest.mark.parametrize(
"cli_args,inputs",
Expand Down
2 changes: 1 addition & 1 deletion tmuxp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def load_workspace(
return _setup_plugins(builder)


@click.group(context_settings={'obj': {}})
@click.group(context_settings={'obj': {}, 'help_option_names':['-h', '--help']})
@click.version_option(__version__, '-V', '--version', message='%(prog)s %(version)s')
@click.option(
'--log-level',
Expand Down
0