diff --git a/barcodeforge/cli.py b/barcodeforge/cli.py index 4ff7d12..b04e2ff 100644 --- a/barcodeforge/cli.py +++ b/barcodeforge/cli.py @@ -34,32 +34,38 @@ def cli(ctx, debug): @click.argument("tree", type=click.Path(exists=True, readable=True)) @click.argument("lineages", type=click.Path(exists=True, readable=True)) @click.option( - "--tree_format", + "-t", + "--tree-format", type=click.Choice(["newick", "nexus"], case_sensitive=False), help="Specify the format of the tree file (newick or nexus)", ) @click.option( + "-u", "--usher-args", type=str, default="", help="Additional arguments to pass to usher (e.g., '-U -l'). Quote multiple arguments.", ) @click.option( + "-T", "--threads", - type=int, + type=click.IntRange(min=1), + metavar="INT", default=8, show_default=True, help="Number of CPUs/threads to use.", ) @click.option( + "-m", "--matutils-overlap", - type=float, + type=click.FloatRange(min=0.0, max=1.0), metavar="FLOAT", - default="0", + default=0, show_default=True, help="Value for --set-overlap in matUtils annotate.", ) @click.option( + "-p", "--prefix", type=str, default="", @@ -67,6 +73,7 @@ def cli(ctx, debug): help="Prefix to add to lineage names in the barcode file.", ) @click.option( + "-c", "--plot-chunk-size", type=int, default=100, diff --git a/barcodeforge/utils.py b/barcodeforge/utils.py index 5639529..31305ca 100644 --- a/barcodeforge/utils.py +++ b/barcodeforge/utils.py @@ -43,7 +43,7 @@ def resolve_tree_format( f"[{STYLES['error']}]Error: Unknown tree format for file '{tree_path}'. Extension '{ext}' is not recognized.[/{STYLES['error']}]" ) console.print( - f"[{STYLES['error']}]Please specify the format using --tree_format ('newick' or 'nexus').[/]" + f"[{STYLES['error']}]Please specify the format using --tree-format ('newick' or 'nexus').[/]" ) raise click.Abort() diff --git a/tests/test_cli.py b/tests/test_cli.py index 51b09d6..c738802 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -389,7 +389,7 @@ def test_barcode_command_nexus_tree(runner, temp_files, mocker): temp_files["alignment"], temp_files["tree"], temp_files["lineages"], - "--tree_format", + "--tree-format", "nexus", ] result = runner.invoke(cli, args, catch_exceptions=False) @@ -446,7 +446,7 @@ def test_barcode_command_newick_tree_reformat(runner, temp_files, mocker): temp_files["alignment"], temp_files["tree"], temp_files["lineages"], - "--tree_format", + "--tree-format", "newick", ] result = runner.invoke(cli, args, catch_exceptions=False)