Example #1
0
File: command.go Project: Jdesk/os
// Populate updates the specified project context based on command line arguments and subcommands.
func Populate(context *project.Context, c *cli.Context) {
	context.ComposeFile = c.GlobalString("file")
	context.ProjectName = c.GlobalString("project-name")

	if c.Command.Name == "logs" {
		context.Log = true
	} else if c.Command.Name == "up" {
		context.Log = !c.Bool("d")
		context.Rebuild = c.Bool("rebuild")
	} else if c.Command.Name == "stop" || c.Command.Name == "restart" || c.Command.Name == "scale" {
		context.Timeout = c.Int("timeout")
	} else if c.Command.Name == "kill" {
		context.Signal = c.String("signal")
	}
}