fix(backup): Switch tags cobra type to handle comma-separated list

This commit is contained in:
Quentin Lemaire 2020-04-13 04:29:13 +02:00
parent 913a34f568
commit ae441d3134
No known key found for this signature in database
GPG Key ID: 5A99AA8DCE71630E
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ type BackupOptions struct {
ExcludeLargerThan string
Stdin bool
StdinFilename string
Tags []string
Tags restic.TagList
Host string
FilesFrom []string
TimeStamp string
@ -121,7 +121,7 @@ func init() {
f.StringVar(&backupOptions.ExcludeLargerThan, "exclude-larger-than", "", "max `size` of the files to be backed up (allowed suffixes: k/K, m/M, g/G, t/T)")
f.BoolVar(&backupOptions.Stdin, "stdin", false, "read backup from stdin")
f.StringVar(&backupOptions.StdinFilename, "stdin-filename", "stdin", "`filename` to use when reading from stdin")
f.StringArrayVar(&backupOptions.Tags, "tag", nil, "add a `tag` for the new snapshot (can be specified multiple times)")
f.Var(&backupOptions.Tags, "tag", "add `tags` for the new snapshot in the format `tag[,tag,...]` (can be specified multiple times)")
f.StringVarP(&backupOptions.Host, "host", "H", "", "set the `hostname` for the snapshot manually. To prevent an expensive rescan use the \"parent\" flag")
f.StringVar(&backupOptions.Host, "hostname", "", "set the `hostname` for the snapshot manually")

View File

@ -717,7 +717,7 @@ func resolveRelativeTargets(filesys fs.FS, targets []string) ([]string, error) {
// SnapshotOptions collect attributes for a new snapshot.
type SnapshotOptions struct {
Tags []string
Tags restic.TagList
Hostname string
Excludes []string
Time time.Time