Inconsistent error handling from CLI

Bug #1631476 reported by Adam Collard
6
This bug affects 1 person
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!)

Revision history for this message
Anastasia (anastasia-macmood) wrote :

There is a bug # 1614948 for point 1 above: error vs ERROR

tags: added: usability
Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.0.1
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.0.1 → none
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Marking as Won't Fix for 2.0 as we are not planning another 2.0.x release.

Changed in juju:
status: Triaged → In Progress
assignee: nobody → Eric Claude Jones (ecjones)
Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR against develop (2.2): https://github.com/juju/juju/pull/7145

Changed in juju:
status: In Progress → Fix Committed
milestone: none → 2.2-beta2
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Follow-up PR against develop (2.2): https://github.com/juju/juju/pull/7198

Changed in juju:
status: Fix Committed → In Progress
milestone: 2.2-beta2 → 2.2-beta3
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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