mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-12 18:54:31 +00:00
32 lines
984 B
Go
32 lines
984 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/rsteube/carapace"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var buildCmd = &cobra.Command{
|
|
Use: "build",
|
|
Short: "Build an OCI image that can run as a container",
|
|
Run: func(cmd *cobra.Command, args []string) {},
|
|
}
|
|
|
|
func init() {
|
|
carapace.Gen(buildCmd).Standalone()
|
|
buildCmd.Flags().StringP("config", "c", "", "path to directory containing a devbox.json config file")
|
|
buildCmd.Flags().String("engine", "docker", "Engine used to build the container: 'docker', 'podman'")
|
|
buildCmd.Flags().String("name", "devbox", "name for the container")
|
|
buildCmd.Flags().Bool("no-cache", false, "Do not use a cache")
|
|
buildCmd.Flags().StringSlice("tags", []string{}, "tags for the container")
|
|
rootCmd.AddCommand(buildCmd)
|
|
|
|
carapace.Gen(buildCmd).FlagCompletion(carapace.ActionMap{
|
|
"config": carapace.ActionDirectories(),
|
|
"engine": carapace.ActionValues("docker", "podman"),
|
|
})
|
|
|
|
carapace.Gen(buildCmd).PositionalCompletion(
|
|
carapace.ActionDirectories(),
|
|
)
|
|
}
|