command.go

 1package restic
 2
 3//go:generate go run git.secluded.site/keld/cmd/gen-restic-cmds
 4
 5// Command describes a restic subcommand and its accepted flags, as parsed
 6// from restic's generated man pages.
 7type Command struct {
 8	Name        string
 9	Description string
10	Options     []Option
11}
12
13// Option describes a single CLI flag accepted by a restic command.
14type Option struct {
15	Name        string // long flag name without dashes, e.g. "dry-run"
16	Alias       string // single-char short flag, e.g. "n"
17	Default     string // default value as printed in the man page
18	Description string
19	Repeatable  bool // true when the flag accepts multiple values (default "[]")
20	IsBool      bool // true for boolean flags (default "false" or "true")
21}