Skip to content

Commit

Permalink
fix(cli): use -v for verbose and simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
qartik committed Jan 23, 2024
1 parent 1f401de commit 74227d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Install additional dependencies needed for the CLI using `pip install pytket-phi

```sh
❯ phirc -h
usage: phirc [-h] [-w WASM_FILE] [-m {H1-1,H1-2}] [-o {0,1,2}] [--verbose | --no-verbose] [-v] qasm_files [qasm_files ...]
usage: phirc [-h] [-w WASM_FILE] [-m {H1-1,H1-2}] [-o {0,1,2}] [-v] [--version] qasm_files [qasm_files ...]

Emulates QASM program execution via PECOS

Expand All @@ -38,11 +38,11 @@ options:
-w WASM_FILE, --wasm-file WASM_FILE
Optional WASM file for use by the QASM programs
-m {H1-1,H1-2}, --machine {H1-1,H1-2}
machine name, H1-1 by default
Machine name, H1-1 by default
-o {0,1,2}, --tket-opt-level {0,1,2}
TKET optimization level, 0 by default
--verbose, --no-verbose
-v, --version show program's version number and exit
-v, --verbose
--version show program's version number and exit
```
## Development
Expand Down
7 changes: 3 additions & 4 deletions pytket/phir/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# mypy: disable-error-code="misc"
# ruff: noqa: T201

from argparse import ArgumentParser, BooleanOptionalAction
from argparse import ArgumentParser
from importlib.metadata import version

from pecos.engines.hybrid_engine import HybridEngine # type:ignore [import-not-found]
Expand Down Expand Up @@ -43,7 +43,7 @@ def main() -> None:
"--machine",
choices=["H1-1", "H1-2"],
default="H1-1",
help="machine name, H1-1 by default",
help="Machine name, H1-1 by default",
)
parser.add_argument(
"-o",
Expand All @@ -52,9 +52,8 @@ def main() -> None:
default="0",
help="TKET optimization level, 0 by default",
)
parser.add_argument("--verbose", action=BooleanOptionalAction)
parser.add_argument("-v", "--verbose", action="store_true")
parser.add_argument(
"-v",
"--version",
action="version",
version=f'{version("pytket-phir")}',
Expand Down

0 comments on commit 74227d3

Please sign in to comment.