Exemple #1
0
func newModifyFlags() *modifyFlags {
	m := &modifyFlags{}

	flagSet := flag.NewFlagSet("modify", flag.ContinueOnError)
	flagSet.BoolVar(&m.force, "f", false, "Force creation of tags on not taggable image")
	flagSet.Var(flags.NewStringSlice(nil, &m.createTags), "create-tags", "Create  or override tags")
	flagSet.Var(flags.NewStringSlice(nil, &m.deleteTags), "delete-tags", "Delete tags")
	flagSet.Var(flags.NewIntSlice(nil, &m.imageIds), "ids", "Images to be delete with actions")
	m.helpMsg = `Usage: images modify --providers sl [options]

  Modify AMI properties.

Options:

  -ids         "123,..."   Images to be used with below actions
  -create-tags "key=val,..."   Create or override tags
  -delete-tags "key,..."       Delete tags
  -f                           Force creation of tags on not taggable image.
`
	flagSet.Usage = func() {
		fmt.Fprintf(os.Stderr, m.helpMsg)
	}

	flagSet.SetOutput(ioutil.Discard) // don't print anything without my permission
	m.flagSet = flagSet
	return m
}
Exemple #2
0
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
}
Exemple #3
0
func newDeleteOptions() *DeleteOptions {
	d := &DeleteOptions{}

	flagSet := flag.NewFlagSet("delete", flag.ContinueOnError)
	flagSet.Var(flags.NewIntSlice(nil, &d.ImageIds), "ids", "Images to be delete with the given ids")
	d.helpMsg = `Usage: images delete --providers do [options]

  Delete images

Options:

  -ids         "123,..."       Images to be deleted with the given ids
`
	flagSet.Usage = func() {
		fmt.Fprintf(os.Stderr, d.helpMsg)
	}

	flagSet.SetOutput(ioutil.Discard) // don't print anything without my permission
	d.flagSet = flagSet
	return d
}
Exemple #4
0
func newRenameOptions() *RenameOptions {
	r := &RenameOptions{}

	flagSet := flag.NewFlagSet("modify", flag.ContinueOnError)
	flagSet.Var(flags.NewIntSlice(nil, &r.ImageIds), "ids", "Images to be delete with the given ids")
	flagSet.StringVar(&r.Name, "name", "", "New name for the images")
	r.helpMsg = `Usage: images modify --providers do [options]

  Rename images

Options:

  -ids         "123,..."       Images to be renamed
  -name        "example"       New name for the images
`
	flagSet.Usage = func() {
		fmt.Fprintf(os.Stderr, r.helpMsg)
	}

	flagSet.SetOutput(ioutil.Discard) // don't print anything without my permission
	r.flagSet = flagSet
	return r
}