"snap restore --help" lists arguments in reverse than that it accepts

snap restore --help shows

Usage:
  snap restore [restore-OPTIONS] <snap> <id>...

When tried I got an error:
dev@dhcppc4:~$ sudo snap restore wdog 2
error: invalid argument for snapshot set id: expected a non-negative integer argument (see 'snap help saved')
dev@dhcppc4:~$

But when I reversed the arg sequence it worked
dev@dhcppc4:~$ sudo snap restore 2 wdog
Restored snapshot #1.
dev@dhcppc4:~$

Please correct the arg seq in help o/p to:
Usage:
snap restore [restore-OPTIONS] <id> <snap>

Thanks for reporting this. It does look like a bug in the help message.

Edit: opened a PR with the fix: https://github.com/snapcore/snapd/pull/8624

1 Like