-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
workspace_new.go
33 lines (26 loc) · 1.01 KB
/
workspace_new.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
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/tofu"
"github.com/spf13/cobra"
)
var workspace_newCmd = &cobra.Command{
Use: "new [OPTIONS] NAME",
Short: "Create a new workspace",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(workspace_newCmd).Standalone()
workspace_newCmd.Flags().BoolS("lock", "lock", false, "Don't hold a state lock during the operation.")
workspace_newCmd.Flags().StringS("lock-timeout", "lock-timeout", "", "Duration to retry a state lock.")
workspace_newCmd.Flags().StringS("state", "state", "", "Copy an existing state file into the new workspace.")
workspaceCmd.AddCommand(workspace_newCmd)
workspace_newCmd.Flag("lock-timeout").NoOptDefVal = " "
workspace_newCmd.Flag("state").NoOptDefVal = " "
carapace.Gen(workspace_newCmd).FlagCompletion(carapace.ActionMap{
"state": carapace.ActionFiles(),
})
carapace.Gen(workspace_newCmd).PositionalCompletion(
tofu.ActionWorkspaces(),
)
}