Skip to content

Commit 0299fd0

Browse files
committed
chore(cli): shorten arguments
1 parent 119344c commit 0299fd0

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Inside the **Analyze Vessels** widget, tune extraction settings and use **Save C
2626
Use the same JSON preset exported from napari to batch-process images.
2727

2828
```sh
29-
vesskel config-init --out config.json
30-
vesskel validate-config --config config.json
29+
vesskel init config.json
30+
vesskel validate config.json
3131
vesskel run --input HRF/manual1 --config config.json --out outputs
3232
```
3333

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def test_main_dispatch_config_init(self, tmp_path, monkeypatch):
470470
from vesskel.cli import main
471471

472472
monkeypatch.setattr(
473-
sys, "argv", ["vesskel", "config-init", "--out", str(tmp_path / "cfg.json")]
473+
sys, "argv", ["vesskel", "init", str(tmp_path / "cfg.json")]
474474
)
475475
exit_code = main()
476476
assert exit_code == 0
@@ -512,7 +512,7 @@ def test_main_dispatch_validate_config(self, tmp_path, monkeypatch):
512512
config_path.write_text(json.dumps(config.to_dict(), indent=2))
513513

514514
monkeypatch.setattr(
515-
sys, "argv", ["vesskel", "validate-config", "--config", str(config_path)]
515+
sys, "argv", ["vesskel", "validate", str(config_path)]
516516
)
517517
exit_code = main()
518518
assert exit_code == 0

vesskel/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ def _make_parser() -> argparse.ArgumentParser:
6565
)
6666

6767
init_parser = subparsers.add_parser(
68-
"config-init",
68+
"init",
6969
help="Create a starter config JSON.",
7070
)
7171
init_parser.add_argument("out", nargs="?", default="vesskel.json", help="Output config path.")
7272

7373
validate_parser = subparsers.add_parser(
74-
"validate-config",
74+
"validate",
7575
help="Validate and print a normalised config JSON.",
7676
)
77-
validate_parser.add_argument("--config", required=True, help="Config JSON path.")
77+
validate_parser.add_argument("config", nargs="?", default="vesskel.json", help="Config JSON path.")
7878

7979
completions_parser = subparsers.add_parser(
8080
"completions",
@@ -279,9 +279,9 @@ def main() -> int:
279279
args = _parse_args()
280280
if args.command == "run":
281281
return _run_batch(args)
282-
if args.command == "config-init":
282+
if args.command == "init":
283283
return _config_init(args)
284-
if args.command == "validate-config":
284+
if args.command == "validate":
285285
return _validate_config(args)
286286
if args.command == "completions":
287287
return _completions(args)

0 commit comments

Comments
 (0)