Skip to content

use built-in version flag, revert to default behavior #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions torchfix/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main() -> None:

parser.add_argument(
"path",
nargs="*",
nargs="+",
help=("Path to check/fix. Can be a directory, a file, or multiple of either."),
)
parser.add_argument(
Expand All @@ -38,8 +38,8 @@ def main() -> None:
)
parser.add_argument(
"--version",
action="store_true",
help="Print current version.",
action="version",
version=f"{TorchFixVersion}"
)

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

args = parser.parse_args()

if args.version:
# TODO: Perhaps add commit hash here if we can
print(f"{TorchFixVersion}")
sys.exit(0)

if not args.path:
parser.print_usage()
sys.exit(1)
Expand Down