-
Notifications
You must be signed in to change notification settings - Fork 17
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
add torchfix --version #14
add torchfix --version #14
Conversation
Also changes the default command to not require an argument and to default to your current working directory Signed-off-by: Eli Uriegas <[email protected]>
@@ -14,7 +14,8 @@ def main() -> None: | |||
|
|||
parser.add_argument( | |||
"path", | |||
nargs="+", | |||
nargs="*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current behavior is intentional to mimic ruff's API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
torchfix --version
won't work otherwise since the invocation will have to look like torchfix --version .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context this is what this looks like if you don't change that:
❯ torchfix --version
usage: torchfix [-h] [--fix] [-j JOBS] [--select {ALL}] [--version] [--show-stderr] path [path ...]
torchfix: error: the following arguments are required: path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's a bigger change, but torchfix --version
should work, and just torchfix
should print help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nargs is fine, but without default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay changed!
Signed-off-by: Eli Uriegas <[email protected]>
Also changes the default command to not require an argument and to default to your current working directory
Fixes #13