mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
fix(backup): Switch tags cobra type to handle comma-separated list
This commit is contained in:
parent
913a34f568
commit
ae441d3134
@ -91,7 +91,7 @@ type BackupOptions struct {
|
|||||||
ExcludeLargerThan string
|
ExcludeLargerThan string
|
||||||
Stdin bool
|
Stdin bool
|
||||||
StdinFilename string
|
StdinFilename string
|
||||||
Tags []string
|
Tags restic.TagList
|
||||||
Host string
|
Host string
|
||||||
FilesFrom []string
|
FilesFrom []string
|
||||||
TimeStamp 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.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.BoolVar(&backupOptions.Stdin, "stdin", false, "read backup from stdin")
|
||||||
f.StringVar(&backupOptions.StdinFilename, "stdin-filename", "stdin", "`filename` to use when reading 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.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")
|
f.StringVar(&backupOptions.Host, "hostname", "", "set the `hostname` for the snapshot manually")
|
||||||
|
@ -717,7 +717,7 @@ func resolveRelativeTargets(filesys fs.FS, targets []string) ([]string, error) {
|
|||||||
|
|
||||||
// SnapshotOptions collect attributes for a new snapshot.
|
// SnapshotOptions collect attributes for a new snapshot.
|
||||||
type SnapshotOptions struct {
|
type SnapshotOptions struct {
|
||||||
Tags []string
|
Tags restic.TagList
|
||||||
Hostname string
|
Hostname string
|
||||||
Excludes []string
|
Excludes []string
|
||||||
Time time.Time
|
Time time.Time
|
||||||
|
Loading…
Reference in New Issue
Block a user