Skip to content

Commit b8c36cd

Browse files
committed
fix: use POSIX/GNU conventions for option word separators
1 parent 92d0c09 commit b8c36cd

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

  • src/ga4gh/vrs/extras/annotator

src/ga4gh/vrs/extras/annotator/cli.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _cli() -> None:
3030

3131

3232
class _LogLevel(str, Enum):
33-
"""Define legal values for `--log_level` option."""
33+
"""Define legal values for `--log-level` option."""
3434

3535
DEBUG = "debug"
3636
INFO = "info"
@@ -42,7 +42,7 @@ class _LogLevel(str, Enum):
4242
def _log_level_option(func: Callable) -> Callable:
4343
"""Provide reusable log level CLI option decorator.
4444
45-
Adds a `--log_level` CLI option to any decorated command. Doesn't pass on any
45+
Adds a `--log-level` CLI option to any decorated command. Doesn't pass on any
4646
values, just sets the logging level for this module.
4747
4848
:param func: incoming click command
@@ -60,7 +60,7 @@ def _set_log_level(ctx: dict, param: str, value: _LogLevel) -> None: # noqa: AR
6060
logging.getLogger(__name__).setLevel(level_map[value])
6161

6262
return click.option(
63-
"--log_level",
63+
"--log-level",
6464
type=click.Choice([v.value for v in _LogLevel.__members__.values()]),
6565
default="info",
6666
help="Set the logging level.",
@@ -73,42 +73,42 @@ def _set_log_level(ctx: dict, param: str, value: _LogLevel) -> None: # noqa: AR
7373
@_cli.command(name="vcf")
7474
@_log_level_option
7575
@click.argument(
76-
"vcf_in",
76+
"vcf-in",
7777
nargs=1,
7878
type=click.Path(exists=True, readable=True, dir_okay=False, path_type=Path),
7979
)
8080
@click.option(
81-
"--vcf_out",
81+
"--vcf-out",
8282
required=False,
8383
type=click.Path(writable=True, allow_dash=False, path_type=Path),
8484
help=(
8585
"Declare save location for output annotated VCF. At least one form of output must be declared."
8686
),
8787
)
8888
@click.option(
89-
"--pkl_out",
89+
"--pkl-out",
9090
required=False,
9191
type=click.Path(writable=True, allow_dash=False, path_type=Path),
9292
help=(
9393
"Declare save location for output PKL file mapping VRS IDs to alleles. At least one form of output must be declared."
9494
),
9595
)
9696
@click.option(
97-
"--ndjson_out",
97+
"--ndjson-out",
9898
required=False,
9999
type=click.Path(writable=True, allow_dash=False, path_type=Path),
100100
help=(
101101
"Declare save location for output NDJSON file dump of VRS alleles. At least one form of output must be declared."
102102
),
103103
)
104104
@click.option(
105-
"--vrs_attributes",
105+
"--vrs-attributes",
106106
is_flag=True,
107107
default=False,
108108
help="Include VRS_Start, VRS_End, and VRS_State fields in the VCF output INFO field.",
109109
)
110110
@click.option(
111-
"--dataproxy_uri",
111+
"--dataproxy-uri",
112112
required=False,
113113
default="seqrepo+http://localhost:5000/seqrepo",
114114
help="URI declaring source of sequence data. See subcommand description for more information.",
@@ -123,13 +123,13 @@ def _set_log_level(ctx: dict, param: str, value: _LogLevel) -> None: # noqa: AR
123123
type=str,
124124
)
125125
@click.option(
126-
"--skip_ref",
126+
"--skip-ref",
127127
is_flag=True,
128128
default=False,
129129
help="Skip VRS computation for REF alleles.",
130130
)
131131
@click.option(
132-
"--require_validation",
132+
"--require-validation",
133133
is_flag=True,
134134
default=False,
135135
help="Require validation checks to pass to construct a VRS object.",
@@ -155,12 +155,12 @@ def _annotate_vcf_cli(
155155
) -> None:
156156
"""Extract VRS objects from VCF located at VCF_IN.
157157
158-
$ vrs-annotate vcf input.vcf.gz --vcf_out output.vcf.gz --pkl_out vrs_objects.pkl
158+
$ vrs-annotate vcf input.vcf.gz --vcf-out output.vcf.gz --pkl-out vrs_objects.pkl
159159
160-
Note that at least one of --vcf_out, --pkl_out, or --ndjson_out must be selected and
160+
Note that at least one of --vcf-out, --pkl-out, or --ndjson-out must be selected and
161161
defined; otherwise, this process will terminate immediately.
162162
163-
Sequence data from a provider such as SeqRepo is required. Use the `--dataproxy_uri`
163+
Sequence data from a provider such as SeqRepo is required. Use the `--dataproxy-uri`
164164
option or the environment variable `GA4GH_VRS_DATAPROXY_URI` to define its location
165165
(the former will take priority over the latter when both are set).
166166
@@ -199,7 +199,7 @@ def _annotate_vcf_cli(
199199
output_ndjson_path=ndjson_out,
200200
)
201201
except VcfAnnotatorArgsError:
202-
msg = "No VCF, PKL, or NDJSON output path provided -- must set at least one of --vcf_out, --pkl_out, or --ndjson_out"
202+
msg = "No VCF, PKL, or NDJSON output path provided -- must set at least one of --vcf-out, --pkl-out, or --ndjson-out"
203203
if not silent:
204204
click.echo(msg)
205205
_logger.exception(msg)

0 commit comments

Comments
 (0)