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("list", flag.ContinueOnError) flagSet.BoolVar(&l.all, "all", false, "Display system and not taggable images.") flagSet.Var(utils.NewOutputValue(utils.Simplified, &l.output), "output", "Output mode") flagSet.Var(flags.NewIntSlice(nil, &l.imageIds), "ids", "Images to be listed. Default case is all images") l.helpMsg = `Usage: images list --providers sl [options] List AMI properties. Options: -ids "123,..." Images to be listed. By default all images are shown. -all Display all images - systems ones (-SWAP, -METADATA) and not taggable ones as well. By default only taggable images are displayed. -output "json" Output mode of images. (default: "simplified") Available options: "json" 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 do [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 }