-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
stage:add: decide on -c
command vs remainder arg for user's script
#5342
Comments
I don't understand the autocompletion issue with the |
@dberenbaum, that's strange. For me (on Linux), it never autocompletes, with or without DVC's autocompletion. |
@skshetry What are you trying to autocomplete? What shell are you using? Does autocomplete work for you without the |
@dberenbaum Autocompletion issue - the default autocomplete suggests files that I have in a dir when I type @skshetry The decision about string VS reminder was made in the very first version of DVC. I considered a To my mind, the issue with mixing up params is not a major one. By replacing the behavior we might have new issues (the autocomplete is one of them). I suggest not changing the behavior and keep cmd as a reminder. |
Thanks, @dmpetrov! I was trying the equivalent of |
I agree that |
Yup, let's stick with the existing syntax (positional arguments) unless you have any concerns @skshetry . |
On
dvc run
, the remainder positional argument is considered as a script.$ dvc run -n stage_name -o bar -w data echo bar > bar
But, we have heard complaints from users that it's confusing, as trying to add certain flags to
dvc run
at the end is now assumed to be part of the user's script.So, on
stage:add
, we moved it under the-c
/--command
flag and now needs to be explicitly specified and quoted.$ dvc stage add stage_name -o bar -w data -c "echo bar > bar"
@dmpetrov later pointed out that it breaks the autocompletion for users. This discussion was without any DVC's autocompletion installed.
With DVC's autocompletion installed, the autocompletion anyway does not work as it is assumed as a plain string.
Anyway, we have to either choose between
-c
and the remainder arg inrun
.cc @dberenbaum @shcheklein @jorgeorpinel
The text was updated successfully, but these errors were encountered: