예제 #1
0
// Bash-completion command that prints the list of templates as all arguments
func (c *ServicedCli) printTemplatesAll(ctx *cli.Context) {
	args := ctx.Args()

	for _, t := range c.templates() {
		for _, a := range args {
			if t == a {
				goto next
			}
		}
		fmt.Println(t)
	next:
	}
}
예제 #2
0
// Bash-completion command that prints all the snapshot ids as all arguments.
func (c *ServicedCli) printSnapshotsAll(ctx *cli.Context) {
	args := ctx.Args()

	for _, s := range c.snapshots("") {
		for _, a := range args {
			if s == a {
				goto next
			}
			fmt.Println(s)
		next:
		}
	}
}
예제 #3
0
// Bash-completion command that prints the list of available pools as all
// arguments
func (c *ServicedCli) printPoolsAll(ctx *cli.Context) {
	args := ctx.Args()
	pools := c.pools()

	for _, p := range pools {
		for _, a := range args {
			if p == a {
				goto next
			}
		}
		fmt.Println(p)
	next:
	}
}
예제 #4
0
파일: host.go 프로젝트: eval01-tts/serviced
// Bash-completion command that prints a list of available hosts as all
// arguments
func (c *ServicedCli) printHostsAll(ctx *cli.Context) {
	args := ctx.Args()
	hosts := c.hosts()

	// If arg is a host, don't add to the list
	for _, h := range hosts {
		for _, a := range args {
			if h == a {
				goto next
			}
		}
		fmt.Println(h)
	next:
	}
}
예제 #5
0
// Bash-completion command that prints a list of available services as all
// arguments
func (c *ServicedCli) printServicesAll(ctx *cli.Context) {
	args := ctx.Args()
	svcs := c.services()

	// If arg is a service don't add to the list
	for _, s := range svcs {
		for _, a := range args {
			if s == a {
				goto next
			}
		}
		fmt.Println(s)
	next:
	}
}