juju action commands require -e in the "wrong" place

Bug #1461605 reported by Nate Finch
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
juju-core
Won't Fix
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.

Revision history for this message
Aaron Bentley (abentley) wrote :

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

Revision history for this message
Cheryl Jennings (cherylj) wrote :

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'.

Revision history for this message
John A Meinel (jameinel) wrote :

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.

Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
tags: added: improvement
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

+1 to "juju -e XXX <command> ..."

Revision history for this message
Nate Finch (natefinch) wrote :

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).

Revision history for this message
Marco Ceppi (marcoceppi) wrote :

This is also an issue with the environment subcommand FWIW

Revision history for this message
Tim Penhey (thumper) wrote :

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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.