Skip to content

Commit

Permalink
Merge pull request #105 from rsteube/add-docker-engine
Browse files Browse the repository at this point in the history
addedd docker engine subcommand
  • Loading branch information
rsteube authored Sep 4, 2020
2 parents cbee9f6 + 0f357eb commit 04349a6
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
18 changes: 18 additions & 0 deletions completers/docker_completer/cmd/engine.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var engineCmd = &cobra.Command{
Use: "engine",
Short: "Manage the docker engine",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(engineCmd).Standalone()

rootCmd.AddCommand(engineCmd)
}
30 changes: 30 additions & 0 deletions completers/docker_completer/cmd/engine_activate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var engine_activateCmd = &cobra.Command{
Use: "activate",
Short: "Activate Enterprise Edition.",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(engine_activateCmd).Standalone()

engine_activateCmd.Flags().String("containerd", "", "override default location of containerd endpoint")
engine_activateCmd.Flags().Bool("display-only", false, "only display license information and exit")
engine_activateCmd.Flags().String("engine-image", "", "Specify engine image")
engine_activateCmd.Flags().String("format", "", "Pretty-print licenses using a Go template")
engine_activateCmd.Flags().String("license", "", "License File")
engine_activateCmd.Flags().Bool("quiet", false, "Only display available licenses by ID")
engine_activateCmd.Flags().String("registry-prefix", "", "Override the default location where engine images are pulled")
engine_activateCmd.Flags().String("version", "", "Specify engine version (default is to use currently running")
engineCmd.AddCommand(engine_activateCmd)

carapace.Gen(engine_activateCmd).FlagCompletion(carapace.ActionMap{
"license": carapace.ActionFiles(""),
})
}
26 changes: 26 additions & 0 deletions completers/docker_completer/cmd/engine_check.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var engine_checkCmd = &cobra.Command{
Use: "check",
Short: "Check for available engine updates",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(engine_checkCmd).Standalone()

engine_checkCmd.Flags().String("containerd", "", "override default location of containerd endpoint")
engine_checkCmd.Flags().Bool("downgrades", false, "Report downgrades (default omits older versions)")
engine_checkCmd.Flags().String("engine-image", "", "Specify engine image (default uses the same image as currently")
engine_checkCmd.Flags().String("format", "", "Pretty-print updates using a Go template")
engine_checkCmd.Flags().Bool("pre-releases", false, "Include pre-release versions")
engine_checkCmd.Flags().BoolP("quiet", "q", false, "Only display available versions")
engine_checkCmd.Flags().String("registry-prefix", "", "Override the existing location where engine images are pulled")
engine_checkCmd.Flags().Bool("upgrades", false, "Report available upgrades (default true)")
engineCmd.AddCommand(engine_checkCmd)
}
22 changes: 22 additions & 0 deletions completers/docker_completer/cmd/engine_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var engine_updateCmd = &cobra.Command{
Use: "update",
Short: "Update a local engine",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(engine_updateCmd).Standalone()

engine_updateCmd.Flags().String("containerd", "", "override default location of containerd endpoint")
engine_updateCmd.Flags().String("engine-image", "", "Specify engine image (default uses the same image as currently")
engine_updateCmd.Flags().String("registry-prefix", "", "Override the current location where engine images are pulled")
engine_updateCmd.Flags().String("version", "", "Specify engine version")
engineCmd.AddCommand(engine_updateCmd)
}

0 comments on commit 04349a6

Please sign in to comment.