Inconsistent error handling from CLI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Eric Claude Jones | ||
2.0 |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Juju 2.0 RC3's CLI is inconsistent with how it reports errors.
Start as a new user, with Juju 2.0 installed and no controllers or models.
I see a bunch of "Common commands" (aside: why are these alphabetically sorted? They're not a complete reference show me the most important ones first!)
Let's try them (note exit code is first number of subsequent command, no numbers = 0):
⟫ juju-2.0 add-cloud
error: Usage: juju add-cloud <cloud name> <cloud definition file>
2 ⟫ juju-2.0 add-credential
error: Usage: juju add-credential <cloud-name> [-f <credentials.yaml>]
2 ⟫ juju-2.0 add-model
error: model name is required
2 ⟫ juju-2.0 add-relation
error: a relation must involve two applications
2 ⟫ juju-2.0 add-unit
error: no application specified
2 ⟫ juju-2.0 controllers
No controllers registered.
Please either create a new controller using "juju bootstrap" or connect to
another controller that you have been given access to using "juju register".
⟫ juju-2.0 deploy
error: no charm or bundle specified
2 ⟫ juju-2.0 expose
error: no application name specified
2 ⟫ juju-2.0 models
ERROR No controllers registered.
Please either create a new controller using "juju bootstrap" or connect to
another controller that you have been given access to using "juju register".
1 ⟫ juju-2.0 status
ERROR No model in focus.
Please use "juju models" to see models available to you.
You can set current model by running "juju switch"
or specify any other model on the command line using the "-m" flag.
1 ⟫ juju-2.0 switch
ERROR no currently specified model
1 ⟫
Problems
- 1) error vs ERROR (the latter is in red)
- 2) Missing usage summary (on all but add-cloud, add-credential)
- 3) Inconsistent error codes: models, status and switch are 1, rest are 2 (excluding controllers which is 0 - no qualms)
- 4) Inconsistent capitalisation - sometimes it's a sentence (models, status) other times not
- 5) Is my current model "currently specified" (switch), "current" (status in paragraph), "in focus" (status in summary - go home status, you're drunk!)
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 2.0.1 |
Changed in juju: | |
milestone: | 2.0.1 → none |
Changed in juju: | |
status: | In Progress → Fix Committed |
milestone: | none → 2.2-beta2 |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
There is a bug # 1614948 for point 1 above: error vs ERROR