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

Bug #1461605 reported by Nate Finch on 2015-06-03
24
This bug affects 5 people
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 :

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

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

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) on 2015-06-04
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
tags: added: improvement
Eric Snow (ericsnowcurrently) wrote :

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

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

Marco Ceppi (marcoceppi) wrote :

This is also an issue with the environment subcommand FWIW

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  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers