SetGlobalFlags applies the global flags
(flags *flag.FlagSet)
| 39 | |
| 40 | // SetGlobalFlags applies the global flags |
| 41 | func SetGlobalFlags(flags *flag.FlagSet) *GlobalFlags { |
| 42 | globalFlags := &GlobalFlags{ |
| 43 | Vars: []string{}, |
| 44 | Flags: flags, |
| 45 | } |
| 46 | |
| 47 | flags.StringVar(&globalFlags.OverrideName, "override-name", "", "If specified will override the DevSpace project name provided in the devspace.yaml") |
| 48 | flags.BoolVar(&globalFlags.NoWarn, "no-warn", false, "If true does not show any warning when deploying into a different namespace or kube-context than before") |
| 49 | flags.BoolVar(&globalFlags.NoColors, "no-colors", false, "Do not show color highlighting in log output. This avoids invisible output with different terminal background colors") |
| 50 | flags.BoolVar(&globalFlags.Debug, "debug", false, "Prints the stack trace if an error occurs") |
| 51 | flags.BoolVar(&globalFlags.Silent, "silent", false, "Run in silent mode and prevents any devspace log output except panics & fatals") |
| 52 | |
| 53 | flags.StringSliceVarP(&globalFlags.Profiles, "profile", "p", []string{}, "The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified") |
| 54 | flags.BoolVar(&globalFlags.DisableProfileActivation, "disable-profile-activation", false, "If true will ignore all profile activations") |
| 55 | flags.BoolVarP(&globalFlags.SwitchContext, "switch-context", "s", false, "Switches and uses the last kube context and namespace that was used to deploy the DevSpace project") |
| 56 | flags.StringVarP(&globalFlags.Namespace, "namespace", "n", "", "The kubernetes namespace to use") |
| 57 | flags.StringVar(&globalFlags.KubeContext, "kube-context", "", "The kubernetes context to use") |
| 58 | flags.StringSliceVar(&globalFlags.Vars, "var", []string{}, "Variables to override during execution (e.g. --var=MYVAR=MYVALUE)") |
| 59 | flags.StringVar(&globalFlags.KubeConfig, "kubeconfig", "", "The kubeconfig path to use") |
| 60 | |
| 61 | flags.IntVar(&globalFlags.InactivityTimeout, "inactivity-timeout", 0, "Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems") |
| 62 | flags.AddFlag(&flag.Flag{ |
| 63 | Name: "config", |
| 64 | Usage: "DEPRECATED: please use the DEVSPACE_CONFIG environment variable instead", |
| 65 | Hidden: true, |
| 66 | Value: NewStringValue("", &globalFlags.ConfigPath), |
| 67 | }) |
| 68 | return globalFlags |
| 69 | } |
| 70 | |
| 71 | type StringValue string |
| 72 |