func newListFlags() *listFlags { l := &listFlags{} flagSet := flag.NewFlagSet("list", flag.ContinueOnError) flagSet.Var(utils.NewOutputValue(utils.Simplified, &l.output), "output", "Output mode") flagSet.Var(flags.NewStringSlice(nil, &l.imageIds), "ids", "Images to be listed. Default case is all images") flagSet.Var(flags.NewStringSlice(nil, &l.owners), "owners", "Filters the images by the owner. By ddefault self is being used") l.helpMsg = `Usage: images list --providers aws [options] List AMI properties. Options: -ids "ami-123,..." Images to be listed. By default all images are shown. -owners "self,..." Filters the images by the owner. By default self is being used. -output "json" Output mode of images. (default: "simplified") Available options: "json","table" or "simplified" ` flagSet.Usage = func() { fmt.Fprintf(os.Stderr, l.helpMsg) } flagSet.SetOutput(ioutil.Discard) // don't print anything without my permission l.flagSet = flagSet return l }
func newListFlags() *listFlags { l := &listFlags{} flagSet := flag.NewFlagSet("copy", flag.ContinueOnError) flagSet.Var(utils.NewOutputValue(utils.Simplified, &l.output), "output", "Output mode") l.helpMsg = `Usage: images list --providers gce [options] List images Options: -output "json" Output mode of images. (default: "simplified") Available options: "json","table" or "simplified" ` flagSet.Usage = func() { fmt.Fprintf(os.Stderr, l.helpMsg) } flagSet.SetOutput(ioutil.Discard) // don't print anything without my permission l.flagSet = flagSet return l }