Skip to content

Commit 119242f

Browse files
committed
cli: Use choices for log-level, add metavar
1 parent dd49e6b commit 119242f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/tmuxp/cli/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ def create_parser() -> argparse.ArgumentParser:
5555
parser.add_argument(
5656
"--log-level",
5757
action="store",
58-
default="INFO",
59-
help="log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)",
58+
metavar="log-level",
59+
default="info",
60+
choices=["debug", "info", "warning", "error", "critical"],
61+
help='log level (debug, info, warning, error, critical) (default "info")',
6062
)
6163
subparsers = parser.add_subparsers(dest="subparser_name")
6264
load_parser = subparsers.add_parser("load", help="load tmuxp workspaces")

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ def test_help(
931931
pass
932932
result = capsys.readouterr()
933933

934-
assert "usage: tmuxp [-h] [--version] [--log-level LOG_LEVEL]" in result.out
934+
assert "usage: tmuxp [-h] [--version] [--log-level log-level]" in result.out
935935

936936

937937
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)