mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-22 23:51:16 +00:00
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package cmd
|
|
|
|
import (
|
|
"github.com/rsteube/carapace"
|
|
"github.com/rsteube/carapace-bin/pkg/actions/tools/docker"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var container_commitCmd = &cobra.Command{
|
|
Use: "commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]",
|
|
Short: "Create a new image from a container's changes",
|
|
Run: func(cmd *cobra.Command, args []string) {},
|
|
}
|
|
|
|
func init() {
|
|
carapace.Gen(container_commitCmd).Standalone()
|
|
|
|
container_commitCmd.Flags().StringP("author", "a", "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
|
|
container_commitCmd.Flags().StringP("change", "c", "", "Apply Dockerfile instruction to the created image")
|
|
container_commitCmd.Flags().StringP("message", "m", "", "Commit message")
|
|
container_commitCmd.Flags().BoolP("pause", "p", true, "Pause container during commit")
|
|
containerCmd.AddCommand(container_commitCmd)
|
|
|
|
carapace.Gen(container_commitCmd).FlagCompletion(carapace.ActionMap{
|
|
"change": carapace.ActionFiles(),
|
|
})
|
|
|
|
carapace.Gen(container_commitCmd).PositionalCompletion(
|
|
docker.ActionContainers(),
|
|
docker.ActionRepositoryTags(),
|
|
)
|
|
}
|