Skip to content

Commit cf8bf9e

Browse files
authored
Merge pull request #2950 from thaJeztah/fix_usage_and_completion
fix: strip path from usage output and shell-completion scripts
2 parents 934841f + bb4bef2 commit cf8bf9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/buildx/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"path/filepath"
78

89
"github.com/docker/buildx/commands"
910
controllererrors "github.com/docker/buildx/controller/errdefs"
@@ -41,7 +42,8 @@ func runStandalone(cmd *command.DockerCli) error {
4142
}
4243
defer flushMetrics(cmd)
4344

44-
rootCmd := commands.NewRootCmd(os.Args[0], false, cmd)
45+
executable := os.Args[0]
46+
rootCmd := commands.NewRootCmd(filepath.Base(executable), false, cmd)
4547
return rootCmd.Execute()
4648
}
4749

0 commit comments

Comments
 (0)