-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
script_run.go
39 lines (32 loc) · 1.42 KB
/
script_run.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
39
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/terramate"
"github.com/carapace-sh/carapace-bridge/pkg/actions/bridge"
"github.com/spf13/cobra"
)
var script_runCmd = &cobra.Command{
Use: "run",
Short: "Run script in stacks",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(script_runCmd).Standalone()
script_runCmd.Flags().SetInterspersed(false)
script_runCmd.Flags().BoolS("X", "X", false, "Disable all safeguards")
script_runCmd.Flags().Bool("disable-check-gen-code", false, "Disable outdated generated code check")
script_runCmd.Flags().Bool("disable-check-git-remote", false, "Disable checking if local default branch is updated with remote")
script_runCmd.Flags().String("disable-safeguards", "", "Disable safeguards: {all,none,git,git-untracked,git-uncommitted,outdated-code,git-out-of-sync}")
script_runCmd.Flags().Bool("dry-run", false, "Plan the execution but do not execute it")
script_runCmd.Flags().Bool("no-recursive", false, "Do not recurse into child stacks")
scriptCmd.AddCommand(script_runCmd)
carapace.Gen(script_runCmd).FlagCompletion(carapace.ActionMap{
"disable-safeguards": terramate.ActionSafeguards().UniqueList(","),
})
carapace.Gen(script_runCmd).PositionalAnyCompletion(
bridge.ActionCarapaceBin(),
)
carapace.Gen(script_runCmd).DashAnyCompletion(
carapace.ActionPositional(script_runCmd),
)
}