-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
up.go
38 lines (32 loc) · 1.25 KB
/
up.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package cmd
import (
"github.com/f1bonacc1/process-compose/src/admitter"
"github.com/spf13/cobra"
)
// upCmd represents the up command
var upCmd = &cobra.Command{
Use: "up [PROCESS...]",
Short: "Run process compose project",
Long: `Run all the process compose processes.
If one or more process names are passed as arguments,
will start them and their dependencies only`,
Run: func(cmd *cobra.Command, args []string) {
runner := getProjectRunner(args, *pcFlags.NoDependencies, "", []string{})
startHttpServerIfEnabled(!*pcFlags.Headless, runner)
runProject(runner)
},
}
func init() {
rootCmd.AddCommand(upCmd)
nsAdmitter := &admitter.NamespaceAdmitter{}
opts.AddAdmitter(nsAdmitter)
upCmd.Flags().BoolVarP(pcFlags.NoDependencies, "no-deps", "", *pcFlags.NoDependencies, "don't start dependent processes")
upCmd.Flags().AddFlag(rootCmd.Flags().Lookup("namespace"))
upCmd.Flags().AddFlag(rootCmd.Flags().Lookup("config"))
upCmd.Flags().AddFlag(rootCmd.Flags().Lookup("ref-rate"))
upCmd.Flags().AddFlag(rootCmd.Flags().Lookup("tui"))
upCmd.Flags().AddFlag(rootCmd.Flags().Lookup("hide-disabled"))
upCmd.Flags().AddFlag(commonFlags.Lookup("reverse"))
upCmd.Flags().AddFlag(commonFlags.Lookup("sort"))
upCmd.Flags().AddFlag(commonFlags.Lookup("theme"))
}