We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3ee027a + edf2a4f commit a6c3accCopy full SHA for a6c3acc
1 file changed
cmd/root/version.go
@@ -1,6 +1,7 @@
1
package root
2
3
import (
4
+ "github.com/docker/cli/cli-plugins/plugin"
5
"github.com/spf13/cobra"
6
7
"github.com/docker/cagent/pkg/cli"
@@ -22,6 +23,14 @@ func runVersionCommand(cmd *cobra.Command, args []string) {
22
23
telemetry.TrackCommand("version", args)
24
25
out := cli.NewPrinter(cmd.OutOrStdout())
- out.Printf("cagent version %s\n", version.Version)
26
+
27
+ commandName := "docker-agent"
28
+ if cmd.Parent() != nil {
29
+ commandName = cmd.Parent().Name()
30
+ }
31
+ if !plugin.RunningStandalone() {
32
+ commandName = "docker " + commandName
33
34
+ out.Printf("%s version %s\n", commandName, version.Version)
35
out.Printf("Commit: %s\n", version.Commit)
36
}
0 commit comments