juju action commands require -e in the "wrong" place
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | juju-core |
Medium
|
Unassigned | ||
Bug Description
every other juju command takes -e as a parameter after the command, e.g. juju deploy -e <env> <name>. However, the action commands require -e to be after the action sub command, i.e. juju action do -e <env> <name>. Putting -e after juju action results in "error: flag provided but not defined: -e" This is inconsistent, which is annoying, but it also makes juju more difficult to write scripts for, because you can't just always dump -e <env> after the command name.
| Aaron Bentley (abentley) wrote : | #1 |
| Cheryl Jennings (cherylj) wrote : | #2 |
This is the behavior for all supercommands (environment, machine, service, etc).
I would argue that in the scripting case you mention that the command name would be 'juju action do' rather than 'juju action'.
| John A Meinel (jameinel) wrote : | #3 |
I'd personally like to be able to do "juju -e XXX status". While I agree that the command is "juju action do" it would be nice if "-e" could be supplied anywhere.
| Changed in juju-core: | |
| status: | New → Triaged |
| importance: | Undecided → Medium |
| tags: | added: improvement |
| Eric Snow (ericsnowcurrently) wrote : | #4 |
+1 to "juju -e XXX <command> ..."
| Nate Finch (natefinch) wrote : | #5 |
Really, this is a UX nightmare as it stands. The user has to guess where the "right" place is to put the -e command... when really, juju shouldn't care.
juju -e local action do foo
juju action -e local do foo
juju action do -e local foo
juju action do foo -e local
The intent of the user in all of these cases is unambiguous. We shouldn't punish the user for not knowing that "deploy" is a command, but "action" isn't, or that only sub commands take flags, etc. Unless the location of the flag changes its meaning, it should be able to be placed anywhere (and we should try really hard to not have a flag's position change it's meaning, since that's a horrible UX as well).
| Marco Ceppi (marcoceppi) wrote : | #6 |
This is also an issue with the environment subcommand FWIW
| Tim Penhey (thumper) wrote : | #7 |
Yeah, this is an issue.
All the subcommand processing has issues with flag placement.
Definitely need to fix this, but probably at the juju/cmd package level.
| Changed in juju-core: | |
| status: | Triaged → Won't Fix |


It would actually be nice if -e were a global option like -v or --show-log.