Skip to content

Commit

Permalink
Change dimension parameter to singular in cli (#323)
Browse files Browse the repository at this point in the history
* Change dimension parameter name to singular

* Adjust tests
  • Loading branch information
phackstock committed Feb 9, 2024
1 parent 637b8ac commit 8f39de1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions nomenclature/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def cli_valid_yaml(path: Path):
default=None,
)
@click.option(
"--dimensions",
"--dimension",
"dimensions",
help="Optional list of dimensions",
type=str,
multiple=True,
Expand Down Expand Up @@ -68,7 +69,10 @@ def cli_valid_project(
-------
$ nomenclature validate-project .
--definitions <def-folder> --mappings <map-folder>
--dimensions "['<folder1>', '<folder2>', '<folder3>']"
--dimension <folder1>
--dimension <folder2>
--dimension <folder3>
Note
Expand Down
12 changes: 6 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ def test_cli_custom_dimensions_runs():
[
"validate-project",
str(TEST_DATA_DIR / "non-default_dimensions"),
"--dimensions",
"--dimension",
"variable",
"--dimensions",
"--dimension",
"region",
"--dimensions",
"--dimension",
"scenario",
],
)
Expand All @@ -178,7 +178,7 @@ def test_cli_custom_dimensions_fails():
[
"validate-project",
str(TEST_DATA_DIR / "non-default_dimensions"),
"--dimensions",
"--dimension",
"foo",
],
)
Expand All @@ -196,9 +196,9 @@ def test_cli_empty_dimensions_run():
[
"validate-project",
str(TEST_DATA_DIR / "non-default_dimensions_one_empty"),
"--dimensions",
"--dimension",
"variable",
"--dimensions",
"--dimension",
"region",
],
)
Expand Down

0 comments on commit 8f39de1

Please sign in to comment.