You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Strings are not passed as they are to externals #4601
The next command errors because the string after the filter is not passed as it is
gcloud dataproc jobs list --region europe-west1 --limit=50 --filter="labels.table_name=vagabond_tranches" --sort-by="statusHistory[0].stateStartTime"
The error received from the external is this one
ERROR: (gcloud.dataproc.jobs.list) INVALID_ARGUMENT: Could not parse the filter: Unexpected property ''. Expected one of [labels, clusterName, placement.clusterName, status.state, operationType]
How to reproduce
run external command that requires an argument with string
@elferherrera - the issue you linked to is marked Windows-specific. Seems like it would fix the issue you saw on Windows, but you originally saw it on macOS too right?
I just found in a another issue that nu seems to be passing the double quotes literally to external commands that have flags with an = (#4609 (comment)) which seems like it could be related. Could you try your command with spaces on those flags instead of equals, i.e., --filter "labels.table_name=vagabond_tranches" --sort-by "statusHistory[0].stateStartTime" and see if it works?
Should we add a config flag that removes quotes from arguments to externals to behave like bash?
imo, passing arguments to externals should "just work". we continually have issues with it. I'd like to resolve it once and for all. I'm not sure what that resolution looks like though.
In that case I would suggest to go the bash route. It removes all quotes from the arguments to externals. For example, if I call this external like this in bash
arg_tester dataproc jobs list --region europe-west1 --limit=50 --filter="labels.table_name=vagabond_tranches && labels=something" --sort-by="statusHistory[0].stateStartTime"
Activity
elferherrera commentedon Feb 23, 2022
It seems this is not related to nushell but to rust itself
This issue describes it and there is a nightly feature waiting for approval.
I'm closing this issue but leaving this for future reference
sophiajt commentedon Feb 23, 2022
Let's leave this open and tag it
upstream. We may have to work with the Rust teams to help finish it.sophiajt commentedon Feb 23, 2022
@elferherrera - the issue you linked to is marked Windows-specific. Seems like it would fix the issue you saw on Windows, but you originally saw it on macOS too right?
elferherrera commentedon Feb 23, 2022
I see the issue with externals in MacOS and Windows operating system. I linked to that issue for reference with scaped quotes
JCallicoat commentedon Mar 1, 2022
I just found in a another issue that nu seems to be passing the double quotes literally to external commands that have flags with an
=(#4609 (comment)) which seems like it could be related. Could you try your command with spaces on those flags instead of equals, i.e.,--filter "labels.table_name=vagabond_tranches" --sort-by "statusHistory[0].stateStartTime"and see if it works?JCallicoat commentedon Mar 1, 2022
Simple reproducer to show the quotes being passed through to the command:
Compared to zsh:
elferherrera commentedon Mar 1, 2022
@JCallicoat I can confirm that by adding a space the external command works
elferherrera commentedon Jun 21, 2022
@jntrnr @fdncred Should we add a config flag that removes quotes from arguments to externals to behave like bash?
fdncred commentedon Jun 21, 2022
imo, passing arguments to externals should "just work". we continually have issues with it. I'd like to resolve it once and for all. I'm not sure what that resolution looks like though.
elferherrera commentedon Jun 21, 2022
The thing is that bash and zsh does thing differently. Bash removes all quotes before passing it to the external, zsh does it sometimes
fdncred commentedon Jun 21, 2022
I'm willing to try just about anything in order to quit having complaints about external parameters not working.
elferherrera commentedon Jun 21, 2022
In that case I would suggest to go the bash route. It removes all quotes from the arguments to externals. For example, if I call this external like this in bash
it is received by the external like this
Notice that the quotes for
--filterand--sort-byare removed after the equal signfdncred commentedon Jun 21, 2022
Sounds good to me. I'm willing to try that and see how it goes.
Rewrite run_external.rs (#12921)