Skip to content

Commit 744cf78

Browse files
Will-Tylerjeromekelleher
authored andcommitted
Use boolean flag in CLI option
1 parent c222e8b commit 744cf78

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bio2zarr/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ def list_commands(self, ctx):
150150
)
151151

152152
local_alleles = click.option(
153-
"--local-alleles",
154-
type=bool,
153+
"--local-alleles/--no-local-alleles",
155154
show_default=True,
156155
default=True,
157156
help="Use local allele fields to reduce the storage requirements of the output.",

tests/test_cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,15 @@ def test_vcf_explode_missing_and_existing_vcf(self, mocked, tmp_path):
294294
def test_vcf_explode_local_alleles(self, mocked, tmp_path, local_alleles):
295295
icf_path = tmp_path / "icf"
296296
runner = ct.CliRunner(mix_stderr=False)
297+
298+
if local_alleles:
299+
local_alleles_flag = "--local-alleles"
300+
else:
301+
local_alleles_flag = "--no-local-alleles"
302+
297303
result = runner.invoke(
298304
cli.vcf2zarr_main,
299-
f"explode {self.vcf_path} {icf_path}"
300-
f" --local-alleles {str(local_alleles).lower()}",
305+
f"explode {self.vcf_path} {icf_path} {local_alleles_flag}",
301306
catch_exceptions=False,
302307
)
303308
assert result.exit_code == 0

0 commit comments

Comments
 (0)