inconsistency between 'snap interfaces' and 'snap connect/disconnect'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
Low
|
Unassigned |
Bug Description
I was trying to manually connect a snap the other day and noticed that there is a small inconsistency between 'snap interfaces' output and the 'snap connect' command. Eg,
$ snap interfaces
Slot Plug
...
:log-observe snappy-debug
...
Notice how in the snap interfaces output, it is 'slots then plugs'. However, to connect a snap the command line argument ordering is reversed:
$ snap connect
error: the required arguments `<snap>:<plug>` and `<snap>:<slot>` were not provided
My natural inclination was to use the ordering found with 'snap interfaces':
$ sudo snap connect ubuntu-
[|] Connect ubuntu-
error: cannot perform the following tasks:
- Connect ubuntu-
(this error seemed a bit cryptic to me) but then I remembered the ordering was the other way:
$ sudo snap connect snappy-
[/] Connect snappy-
If this is all designed and thought out and an active decision, feel free to mark as "Won't Fix", but I thought I'd at least mention it.
Changed in snappy: | |
status: | New → Confirmed |
importance: | Undecided → Low |
affects: | snappy → snapd |
The small inconsistency there was intentional, but I have a couple of suggestions to fix it.
The problem is this: the second column in the output of snap interfaces, the Plug one, will often have multiple entries (e.g. all plugs connected to :x11, for example). If we display it first, we end up with a very wide column first pushing the second column too far apart for the eye to be able to comfortably related the two.
So, I see two possible ways to fix this, and perhaps we can implement both of them:
1. Instead of aggregating plugs on a single line, we can break them down so that each line has a single slot and plug pair.
2. We can tweak "snap connect" so that it accepts its arguments in any order. This works fine because a snap cannot have a plug and a slot with the same name, so any pair is necessarily unambiguous.