Verifying snap configuration keys and issuing warnings

I hope I’m missing something, but there seems to be no way for a configure hook to verify the keys being set, nor to issue non-fatal warning.

The motivating instance is that a user misspelt

snap set mir-kiosk cursor=none

And instead typed

snap set mir-kiosk hidecursor=true

As that appears to work (it doesn’t report a problem) they didn’t realize their mistake and reported a bug.

What I’d like to be able to do is enumerate the keys set and issue a warning:

snap set mir-kiosk hidecursor=true
Warning: unsupported configuration key: hidecursor
Supported keys are:
cursor:         The way the cursor is displayed. Can be "auto", "software" or "none"
vt:             The virtual terminal to be used in daemon mode
daemon:         Whether to run as a "daemon"
display-layout: Layout of outputs to select from mir-kiosk.display

Verifying snap configuration keys

snapctl requires the configuration key to be specified (there’s no equivalent of snap get mir-kiosk which lists all key-value pairs) so there is no way to enumerate unsupported keys.

Issuing warnings

Now, because of the possibility of keys supported in past or future versions of a snap, any “unsupported key” messages ought to be non-fatal. But the only way to get console output from a configure hook is to exit 1.

Have I missed a way to do this? Or a reason that it should not be possible?

These are fair requests, though it should be noted that the configure hook is also called during refresh/install where there is no user around.

@pedronis time for a snapctl add-warning?

maybe, I think the other request has been around for much longer.