mirror of
https://github.com/restic/restic.git
synced 2026-10-13 05:27:13 +00:00
Some options fixes
Add tests for bool type. Fix subtle bug in TestOptionsApplyInvalid. Fix options list formatting.
This commit is contained in:
1 parent
cb6b0f6255
commit
332b1896d1
2 files changed
+30
-8
No files matched your search
@@ -23,8 +23,14 @@ Exit status is 0 if the command was successful, and non-zero if there was any er
|
||||
DisableAutoGenTag: true,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("All Extended Options:\n")
|
||||
var maxLen int
|
||||
for _, opt := range options.List() {
|
||||
fmt.Printf(" %-15s %s\n", opt.Namespace+"."+opt.Name, opt.Text)
|
||||
if l := len(opt.Namespace + "." + opt.Name); l > maxLen {
|
||||
maxLen = l
|
||||
}
|
||||
}
|
||||
for _, opt := range options.List() {
|
||||
fmt.Printf(" %*s %s\n", -maxLen, opt.Namespace+"."+opt.Name, opt.Text)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user