当前位置: 首页>>代码示例>>Golang>>正文


Golang Command.Name方法代码示例

本文整理汇总了Golang中github.com/codegangsta/cli.Command.Name方法的典型用法代码示例。如果您正苦于以下问题:Golang Command.Name方法的具体用法?Golang Command.Name怎么用?Golang Command.Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/codegangsta/cli.Command的用法示例。


在下文中一共展示了Command.Name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: serviceCommand

func serviceCommand() cli.Command {
	factory := &projectFactory{}

	app := cli.Command{}
	app.Name = "service"
	app.ShortName = "s"
	app.Usage = "Command line interface for services and compose."
	app.Before = beforeApp
	app.Flags = append(command.CommonFlags(), dockerApp.DockerClientFlags()...)
	app.Subcommands = append(serviceSubCommands(),
		command.BuildCommand(factory),
		command.CreateCommand(factory),
		command.UpCommand(factory),
		command.StartCommand(factory),
		command.LogsCommand(factory),
		command.RestartCommand(factory),
		command.StopCommand(factory),
		command.ScaleCommand(factory),
		command.RmCommand(factory),
		command.PullCommand(factory),
		command.KillCommand(factory),
		command.PortCommand(factory),
		command.PsCommand(factory),
	)

	return app
}
开发者ID:carriercomm,项目名称:os,代码行数:27,代码来源:service.go

示例2: selinuxCommand

func selinuxCommand() cli.Command {
	app := cli.Command{}
	app.Name = "selinux"
	app.Usage = "Launch SELinux tools container."
	app.Action = func(c *cli.Context) error {
		argv := []string{"system-docker", "run", "-it", "--privileged", "--rm",
			"--net", "host", "--pid", "host", "--ipc", "host",
			"-v", "/usr/bin/docker:/usr/bin/docker.dist:ro",
			"-v", "/usr/bin/ros:/usr/bin/dockerlaunch:ro",
			"-v", "/usr/bin/ros:/usr/bin/user-docker:ro",
			"-v", "/usr/bin/ros:/usr/bin/system-docker:ro",
			"-v", "/usr/bin/ros:/sbin/poweroff:ro",
			"-v", "/usr/bin/ros:/sbin/reboot:ro",
			"-v", "/usr/bin/ros:/sbin/halt:ro",
			"-v", "/usr/bin/ros:/sbin/shutdown:ro",
			"-v", "/usr/bin/ros:/usr/bin/respawn:ro",
			"-v", "/usr/bin/ros:/usr/bin/ros:ro",
			"-v", "/usr/bin/ros:/usr/bin/cloud-init:ro",
			"-v", "/usr/bin/ros:/usr/sbin/netconf:ro",
			"-v", "/usr/bin/ros:/usr/sbin/wait-for-network:ro",
			"-v", "/usr/bin/ros:/usr/sbin/wait-for-docker:ro",
			"-v", "/var/lib/docker:/var/lib/docker",
			"-v", "/var/lib/rkt:/var/lib/rkt",
			"-v", "/dev:/host/dev",
			"-v", "/etc/docker:/etc/docker",
			"-v", "/etc/hosts:/etc/hosts",
			"-v", "/etc/resolv.conf:/etc/resolv.conf",
			"-v", "/etc/rkt:/etc/rkt",
			"-v", "/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt.rancher",
			"-v", "/lib/firmware:/lib/firmware",
			"-v", "/lib/modules:/lib/modules",
			"-v", "/run:/run",
			"-v", "/usr/share/ros:/usr/share/ros",
			"-v", "/var/lib/rancher/conf:/var/lib/rancher/conf",
			"-v", "/var/lib/rancher:/var/lib/rancher",
			"-v", "/var/log:/var/log",
			"-v", "/var/run:/var/run",
			"-v", "/home:/home",
			"-v", "/opt:/opt",
			"-v", "/etc/selinux:/etc/selinux",
			"-v", "/var/lib/selinux:/var/lib/selinux",
			"-v", "/usr/share/selinux:/usr/share/selinux",
			fmt.Sprintf("rancher/os-selinuxtools:%s", config.VERSION+config.SUFFIX), "bash"}
		syscall.Exec("/bin/system-docker", argv, []string{})
		return nil
	}

	return app
}
开发者ID:xingdl2007,项目名称:os,代码行数:49,代码来源:selinux.go


注:本文中的github.com/codegangsta/cli.Command.Name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。