mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-16 04:34:32 +00:00
25 lines
654 B
Go
25 lines
654 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/rsteube/carapace"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version [OPTIONS]",
|
|
Short: "Show the Docker Compose version information",
|
|
Run: func(cmd *cobra.Command, args []string) {},
|
|
}
|
|
|
|
func init() {
|
|
carapace.Gen(versionCmd).Standalone()
|
|
|
|
versionCmd.Flags().StringP("format", "f", "", "Format the output. Values: [pretty | json]. (Default: pretty)")
|
|
versionCmd.Flags().Bool("short", false, "Shows only Compose's version number.")
|
|
rootCmd.AddCommand(versionCmd)
|
|
|
|
carapace.Gen(versionCmd).FlagCompletion(carapace.ActionMap{
|
|
"format": carapace.ActionValues("pretty", "json"),
|
|
})
|
|
}
|