incorrect command option gives ugly output

Bug #1379934 reported by Jeff Lane on 2014-10-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Lee Trager

Bug Description

when running maas via cli, the output when entering an invalid option is ugly and should be fixed to dump the usage instead.

ubuntu@critical-maas:~$ maas maas boot-resources help
usage: /usr/lib/python2.7/dist-packages/maascli/ maas
       [-h] COMMAND ...
/usr/lib/python2.7/dist-packages/maascli/ maas: error: argument COMMAND: invalid choice: u'boot-resources' (choose from 'account', 'boot-images', 'commissioning-results', 'commissioning-script', 'commissioning-scripts', 'file', 'files', 'maas', 'node-group', 'node-group-interface', 'node-group-interfaces', 'node-groups', 'node', 'node-mac', 'node-macs', 'nodes', 'sshkey', 'sshkeys', 'tag', 'tags', 'users', 'zone', 'zones')

It would be better if that triggered the help for maas:ubuntu@critical-maas:~$ maas maas -h
usage: /usr/lib/python2.7/dist-packages/maascli/ maas
       [-h] COMMAND ...

Issue commands to the MAAS region controller at

optional arguments:
  -h, --help show this help message and exit

drill down:
    account Manage the current logged-in user.
                        Read the collection of NodeCommissionResult in the
                        Manage a custom commissioning script.
                        Manage custom commissioning scripts.
    file Manage a FileStorage object.
    files File management operations.
    maas Manage the MAAS server.
    node-group Manage a NodeGroup.
                        Manage a NodeGroupInterface.
                        Manage NodeGroupInterfaces.
    node-groups Manage NodeGroups.
    node Manage an individual Node.
    node-mac Manage a MAC address.
    node-macs Manage MAC addresses for a given Node.
    nodes Manage the collection of all Nodes in the MAAS.
    sshkey Manage an SSH key.
    sshkeys Operations on multiple keys.
    tag Manage individual Tags.
    tags Manage collection of Tags.
    users API for user accounts.
    zone Manage an availability zone.
    zones API for availability zones.

This is a profile. Any commands you issue on this profile will
operate on the MAAS region server.

The command information you see here comes from the region server's
API; it may differ for different profiles. If you believe the API may
have changed, use the command's 'refresh' sub-command to fetch the
latest version of this help information from the server.

Related branches

Julian Edwards (julian-edwards) wrote :

Related to bug 1313685

Changed in maas:
status: New → Triaged
importance: Undecided → Low
tags: added: cli papercut
Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
milestone: none → 1.9.0
Changed in maas:
assignee: nobody → Lee Trager (ltrager)
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers