"snap" command gives no way to display current config

Command “snap” has set/unset for config settings, but no way to display current settings. Please add a way.

$ snap --version
snap    2.45.1+20.04
snapd   2.45.1+20.04
series  16
ubuntu  20.04
kernel  5.4.0-40-generic

if i do (on my laptop):

$ sudo snap get system
Key           Value
experimental  {...}
seed          {...}
snapshots     {...}

it returns the set keys …
doing the same on an Ubuntu Core image (pi4):

$ snap get system
Key        Value
pi-config  {...}
proxy      {...}
seed       {...}

was that what you were missing ?

$ sudo snap get system
Key           Value
experimental  {...}
refresh       {...}
seed          {...}
$ sudo snap get system refresh
Key            Value
refresh.hold   2020-07-26T12:12:01+01:00
refresh.timer  sun,12:00

Works for me.

Ah, an undocumented (in the man page) keyword “system”. Nice. Could we get this into the man page, please ?

that would probably result in a rather large manpage …

Just document that the word “system” can be used in place of the name of a snap, for “get”. No need to document all the config keywords there, maybe link to a document somewhere, so people will know what can be set through “set”.

1 Like

Perhaps @degville can take a look at this request? I’m not sure where the source for our man pages comes from actually, I have only ever modified the online docs and the --help messages for commands.

Yep, happy to add this to the docs/look into add into to our man page (I’ve not looked into this either). I agree system is something we should probably expose to help easy retrieval of settings.

2 Likes
xxx@localhost : / $ snap --version

snap 2.47.1

snapd 2.47.1

series 16

kernel 5.3.0-1036-raspi2

xxx@localhost : /$ snap get system

Key Value

seed {...}

XXX@localhost : / $ snap get system seed

Key Value

seed.loaded true

That’s all I got, seed. loaded true, nothing else. Anything like “snap get system pi-config” or “snap get pi-config” gets an error message. What am I missing?

Although it says Kernel 5.3.0-1036-raspi2, it’s really a Core 18, RPi 4, arm64 image downloaded from Ubuntu, just booted up.

nothing … pi-config is usually empty so it will not be shown … if you set a key for it it will also get listed …

possible options are listed here:

So, what I missed is the esoteric secret the document didn’t say – if fields are not set, they do not display. And by default, none of these are set. Doh!

That would be very helpful in the document to avoid confusion.

Thanks for clearly that up!

2 Likes

That’s a great point about the fields not being set. I’ll make it clearer in our docs. Thanks!

2 Likes