snap disable <s1> <s2> doesn't disable s2, or complain

Bug #1851157 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
Unassigned

Bug Description

snap disable --help doesn't say that it takes multiple snaps as arguments (perhaps it should but that's a different feature request), but when providing multiple snaps as arguments it just silently does the first snap and ignores the rest of the arguments. See:

```
$ snap disable --help
Usage:
  snap disable [disable-OPTIONS] <snap>

The disable command disables a snap. The binaries and services of the
snap will no longer be available, but all the data is still available
and the snap can easily be enabled again.

[disable command options]
      --no-wait Do not wait for the operation to finish but just print the change id.
$ snap disable hello-world yq
hello-world disabled
$ snap list hello-world --all
Name Version Rev Tracking Publisher Notes
hello-world 6.4 29 stable canonical✓ disabled
$ snap list yq --all
Name Version Rev Tracking Publisher Notes
yq 2.4.0 352 stable mikefarah -
```

snap disable should probably complain about multiple snap arguments, maybe accept multiple snaps to be disabled

Revision history for this message
Claudio Matsuoka (cmatsuoka) wrote :

The solution to adopt for `disable` should of course be consistent with `enable` (which also suffers from the same problem), and it would be ideal to have an overall consistency on how commands behave (for example `list` and `info` accept multiple snap arguments).

```
 snap list hello-world yq
Name Version Rev Tracking Publisher Notes
hello-world 6.4 29 stable canonical✓ -
yq 2.4.0 352 stable mikefarah disabled
```

Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
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.