diff options
Diffstat (limited to 'src/mongo/gotools/vendor/src/github.com/jessevdk/go-flags/examples/add.go')
-rw-r--r-- | src/mongo/gotools/vendor/src/github.com/jessevdk/go-flags/examples/add.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mongo/gotools/vendor/src/github.com/jessevdk/go-flags/examples/add.go b/src/mongo/gotools/vendor/src/github.com/jessevdk/go-flags/examples/add.go new file mode 100644 index 00000000000..57d8f232b21 --- /dev/null +++ b/src/mongo/gotools/vendor/src/github.com/jessevdk/go-flags/examples/add.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" +) + +type AddCommand struct { + All bool `short:"a" long:"all" description:"Add all files"` +} + +var addCommand AddCommand + +func (x *AddCommand) Execute(args []string) error { + fmt.Printf("Adding (all=%v): %#v\n", x.All, args) + return nil +} + +func init() { + parser.AddCommand("add", + "Add a file", + "The add command adds a file to the repository. Use -a to add all files.", + &addCommand) +} |