'--long' option is required when we want to display non-default columns with '-c' option

Bug #1589135 reported by Akihiro Motoki
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Triaged
Wishlist
Akihiro Motoki

Bug Description

in OSC, when we want to display non-default columns with '-c' option, '--long' option must be specified as well. I think it is redundant and annoying.

I think it is better to lookup all fields when '-c' option is specified as if '--long' option is specified. I believe It improves user experience.

------
(The following is the original bug description)

In OSC, there is no way to display non-default columns in list commands.

OSC has -c option which specifies which columns should be displayed, but only the default columns can be specified.
For example, openstack network list has ID, Name, Subnets as defaults columns.
For example, neutron network resource has 'status' field, but there is no way to display it.

In neutron CLI, we can display non-default columns by specifying -c option.
Similarly nova list has '--fields' option and we can specify non-default fields.

OSC should support these scenario.

Tags: network
Akihiro Motoki (amotoki)
Changed in python-openstackclient:
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
Steve Martinelli (stevemar) wrote :

wouldn't this be fixed by adding the --long option ?

I guess you don't want to have to know the non-default column exists in the "short" or "long" output

Changed in python-openstackclient:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Yes, I recently noticed we can see non-default columns by specifying --long option.

As you guessed, honestly I don't want to specify '--long' when I want to specify columns to be displayed.
From user perspective, it is redundant to combining '--long' and '-c'.
In my understanding, '--long' option is a convenient way to show all fields.

My idea is that when '-c' option(s) are provided all fields are always search (as if '--long' option is specified).

Thought?

summary: - no way to display non-default columns in list commands
+ '--long' option is required when we want to display non-default columns
+ with '-c' option
description: updated
Revision history for this message
Steve Martinelli (stevemar) wrote :

It's a legitimate issue. I'm just not sure how to fix this in OSC, since --long is part of the OSC individual command and -c is part of cliff.

We'd have to inspect if -c is used in the OSC layer, which seems weird. Then change the columns we output based on that flag. It just seems slightly backwards.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

we can know what columns are specified by '-c' option by checking parsed_args.columns. neutronclient use this [1]. OSC can do the similar.

As you mentioned, "parsed_args.columns" is a cliff option and I am not sure it is a public way.
On the other hand, I think it is useful that cliff application can know what columns are requested. For example, we can retrieve only the requested fields through API.

[1] http://git.openstack.org/cgit/openstack/python-neutronclient/tree/neutronclient/neutron/v2_0/__init__.py#n704

Revision history for this message
Richard Theis (rtheis) wrote :

Hi Akihiro, I also agree this is a legitimate issue and is worth a broader discussion with Dean and others on how to solve.

Do you know if other project CLIs have similar solutions to the neutron CLI?

Richard Theis (rtheis)
tags: added: network
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.