nils-werner / crestic

Configurable Restic Wrapper
https://nils-werner.github.io/crestic/
MIT License
107 stars 9 forks source link

Parameter ordering matters? #14

Closed codl closed 4 years ago

codl commented 4 years ago

I ran into this while trying to add a tag to a snapshot:

~$ crestic home@fugu tag --add test 25085535
usage: crestic [--add [ADD]] [preset] command [arguments [arguments ...]]
crestic: error: unrecognized arguments: 25085535
~$ crestic home@fugu tag 25085535 --add test
repository c367f242 opened successfully, password is correct
create exclusive lock for repository
modified tags on 1 snapshots
~$

Whereas in plain restic, either order works:

~$ restic tag --add test 3b016f5f
repository 1f5e7f58 opened successfully, password is correct
create exclusive lock for repository
modified tags on 1 snapshots
~$ restic tag db85fd43 --add test                                      
repository 1f5e7f58 opened successfully, password is correct
create exclusive lock for repository
modified tags on 1 snapshots
~$

It doesn't seem intentional that crestic would only accept one of them. Nor that --add shows up as a crestic parameter in the usage text.

nils-werner commented 4 years ago

This is definitely unwanted behaviour and a bug.

nils-werner commented 4 years ago

Restic have fixed the docstring, now correctly showing the order of restic command [flags] [parameters]. I hope that prevents any confusion.