github.com/advanderveer/restic@v0.8.1-0.20171209104529-42a8c19aaea6/cmd/restic/cmd_options.go (about) 1 package main 2 3 import ( 4 "fmt" 5 6 "github.com/restic/restic/internal/options" 7 8 "github.com/spf13/cobra" 9 ) 10 11 var optionsCmd = &cobra.Command{ 12 Use: "options", 13 Short: "Print list of extended options", 14 Long: ` 15 The "options" command prints a list of extended options. 16 `, 17 Hidden: true, 18 DisableAutoGenTag: true, 19 Run: func(cmd *cobra.Command, args []string) { 20 fmt.Printf("All Extended Options:\n") 21 for _, opt := range options.List() { 22 fmt.Printf(" %-15s %s\n", opt.Namespace+"."+opt.Name, opt.Text) 23 } 24 }, 25 } 26 27 func init() { 28 cmdRoot.AddCommand(optionsCmd) 29 }