Skip to content

Commit a8a69e9

Browse files
authored
use built-in version flag, revert to default behavior (#15)
Signed-off-by: Eli Uriegas <github@terriblecode.com>
1 parent a776f3e commit a8a69e9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

torchfix/__main__.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def main() -> None:
1414

1515
parser.add_argument(
1616
"path",
17-
nargs="*",
17+
nargs="+",
1818
help=("Path to check/fix. Can be a directory, a file, or multiple of either."),
1919
)
2020
parser.add_argument(
@@ -38,8 +38,8 @@ def main() -> None:
3838
)
3939
parser.add_argument(
4040
"--version",
41-
action="store_true",
42-
help="Print current version.",
41+
action="version",
42+
version=f"{TorchFixVersion}"
4343
)
4444

4545
# XXX TODO: Get rid of this!
@@ -52,11 +52,6 @@ def main() -> None:
5252

5353
args = parser.parse_args()
5454

55-
if args.version:
56-
# TODO: Perhaps add commit hash here if we can
57-
print(f"{TorchFixVersion}")
58-
sys.exit(0)
59-
6055
if not args.path:
6156
parser.print_usage()
6257
sys.exit(1)

0 commit comments

Comments
 (0)