After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698070 - cli: use 'list' subcommand for listing and 'show' for detailed information
cli: use 'list' subcommand for listing and 'show' for detailed information
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: tracker-nmcli
 
 
Reported: 2013-04-15 17:23 UTC by Pavel Simerda
Modified: 2014-01-06 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pavel Simerda 2013-04-15 17:23:36 UTC
I *think* we formerly agreed to use the 'list' command for *listing*, i.e. printing out a list of connections (according to some criteria) and the 'show' command for printing out details about a single connection.

In the current 'cli-enhance' branch it looks like we're using 'show' instead of 'list' and the intended 'show' action is not available.
Comment 1 Dan Winship 2013-04-17 18:45:25 UTC
I don't remember talking about this before, but I agree we should do it. I've always found the two different "modes" of list to be weird.
Comment 2 Jiri Klimes 2013-04-22 17:03:20 UTC
(In reply to comment #0)
> I *think* we formerly agreed to use the 'list' command for *listing*, i.e.
> printing out a list of connections (according to some criteria) and the 'show'
> command for printing out details about a single connection.
> 
> In the current 'cli-enhance' branch it looks like we're using 'show' instead of
> 'list' and the intended 'show' action is not available.

Yes, we have only 'show' for
nmcli device show [<iface>]
and
nmcli connection show configured [[ id | uuid | path ] <ID>]
nmcli connection show active     [[ id | uuid | path | apath ] <ID>]

because without arguments it shows/lists all connections; with an argument it displays details.

I discussed this with dcbw and he said he considered 'show' to be relevant for both cases (at least from the language point of view ;)
Comment 3 Dan Winship 2013-04-23 14:59:51 UTC
(In reply to comment #2)
> I discussed this with dcbw and he said he considered 'show' to be relevant for
> both cases (at least from the language point of view ;)

yes, either of them *could* make sense as "show", it's just weird that we use the same word to to have two different meanings.

Also, it's inconsistent between dev and con:

  nmcli dev             - simple list of all devices
  nmcli dev show        - full properties of all devices
  nmcli dev show IFNAME - full properties of one device

  nmcli con             - simple list of all connections
  nmcli con show        - simple list of all connections (same)
  nmcli con show ID     - syntax error

(The last one ties into the fact that it's weird that "nmcli con" has commands for both NMConnections and NMActiveConnections, which I think I'll file another bug about.)
Comment 4 Pavel Simerda 2013-04-24 16:50:20 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > I discussed this with dcbw and he said he considered 'show' to be relevant for
> > both cases (at least from the language point of view ;)
> 
> yes, either of them *could* make sense as "show", it's just weird that we use
> the same word to to have two different meanings.

Exactly. I propose to use 'show' for detailed printout of a single item and 'list' for item listings.

> Also, it's inconsistent between dev and con:
> 
>   nmcli dev             - simple list of all devices
>   nmcli dev show        - full properties of all devices

nmcli dev / nmcli dev list → simple list of all devices
nmcli dev show <item> → detailed information about a connection

>   nmcli dev show IFNAME - full properties of one device
> 
>   nmcli con             - simple list of all connections
>   nmcli con show        - simple list of all connections (same)

nmcli con / nmcli con list → simple list of all connections
nmcli con show <item> → detailed information about a connection

>   nmcli con show ID     - syntax error

That's not nice.

As for other tools, iproute uses 'show' and doesn't have different output formats (one-line/full). Yum does use different commands, 'list' for listing, 'info' for details (I consider 'show' superior to 'info', though).

> (The last one ties into the fact that it's weird that "nmcli con" has commands
> for both NMConnections and NMActiveConnections, which I think I'll file another
> bug about.)

Ah, yes, this should be resolved. Already commented.
Comment 5 Dan Winship 2013-05-02 15:59:35 UTC
NM bugzilla reorganization... sorry for the bug spam.
Comment 6 Dan Winship 2014-01-02 17:58:00 UTC
so... is anything going to change here? If not, we should close this bug now
Comment 7 Jiri Klimes 2014-01-06 09:46:34 UTC
I think, we are not going to change anything here. Closing.