Merge pull request #2950 from thaJeztah/fix_usage_and_completion

fix: strip path from usage output and shell-completion scripts
This commit is contained in:
CrazyMax 2025-02-02 01:11:29 +01:00 committed by GitHub
commit cf8bf9e104
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import (
"context"
"fmt"
"os"
"path/filepath"
"github.com/docker/buildx/commands"
controllererrors "github.com/docker/buildx/controller/errdefs"
@ -41,7 +42,8 @@ func runStandalone(cmd *command.DockerCli) error {
}
defer flushMetrics(cmd)
rootCmd := commands.NewRootCmd(os.Args[0], false, cmd)
executable := os.Args[0]
rootCmd := commands.NewRootCmd(filepath.Base(executable), false, cmd)
return rootCmd.Execute()
}