snap list doesn't do globbing

Bug #2006526 reported by Seth Arnold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Hello, while trying to help a user on IRC today, a helper assumed that the snap list command would perform globbing, similar to the dpkg -l command. However, snap list does not perform globbing:

$ snap list 'b*'
error: no matching snaps installed
$ snap list 'c*'
error: no matching snaps installed
$ snap list
Name Version Rev Tracking Publisher Notes
bandit 1.7.4 108 latest/stable alexmurray✪ -
bare 1.0 5 latest/stable canonical✓ base
canonical-livepatch 10.4.1 164 latest/stable canonical✓ -
chromium 109.0.5414.119 2295 latest/stable canonical✓ -
core 16-2.58 14447 latest/stable canonical✓ core
core18 20230118 2679 latest/stable canonical✓ base
core20 20230126 1822 latest/stable canonical✓ base
cups 2.4.2-5 872 latest/stable openprinting✓ -
cvescan 2.5.0 281 latest/stable canonical✓ -
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 161 latest/stable canonical✓ -
gnome-3-38-2004 0+git.6f39565 119 latest/stable canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical✓ -
lp-to-jira 0.7 56 latest/stable mclemenceau -
lxd 5.10-b392610 24323 latest/stable canonical✓ -
matterhorn 50200.17.0-4-g71917a58 369 latest/edge 3v1n0 -
ssh-audit 2.5.0-2 6 latest/stable positronsecurity -
youtube-dl 2021.12.17+git01bf89e 4806 latest/stable joeborg -

In these examples I expected the first command to show me bandit and bare, and the second command to show seven snaps, etc.

Compare dpkg:

$ dpkg -l 'ba*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============-=================-============-=========================================================
un backupninja <none> <none> (no description available)
un backuppc <none> <none> (no description available)
un bambootracker <none> <none> (no description available)
un base <none> <none> (no description available)
un base-config <none> <none> (no description available)
ii base-files 11ubuntu5.6 amd64 Debian base system miscellaneous files
ii base-passwd 3.5.47 amd64 Debian base system master password and group files
ii bash 5.0-6ubuntu1.2 amd64 GNU Bourne Again SHell
ii bash-completion 1:2.10-1ubuntu1 all programmable completion for the bash shell
un bash-doc <none> <none> (no description available)
un bash-static <none> <none> (no description available)
ii bat 0.12.1-1ubuntu0.2 amd64 cat(1) clone with syntax highlighting and git integration
$

Thanks

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: snap (not installed)
ProcVersionSignature: Ubuntu 5.4.0-137.154-generic 5.4.218
Uname: Linux 5.4.0-137-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu27.25
Architecture: amd64
CasperMD5CheckResult: skip
Date: Wed Feb 8 00:59:47 2023
SourcePackage: snap
UpgradeStatus: Upgraded to focal on 2020-01-24 (1110 days ago)

Revision history for this message
Seth Arnold (seth-arnold) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote :

If globbing is considered a bad idea, can I ask for an error message that is clear that the argument is a singular, specific, name?

Perhaps "No snap named $arg installed" or "That snap isn't installed".

Thanks

Paul White (paulw2u)
affects: snap (Ubuntu) → snapd (Ubuntu)
Changed in snapd (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
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.