support DEBUG when expanding aliases
This commit is contained in:
parent
52a02a7a4b
commit
8773a997ee
1 changed files with 4 additions and 0 deletions
|
|
@ -39,11 +39,15 @@ func main() {
|
|||
|
||||
cmd, _, err := command.RootCmd.Traverse(expandedArgs)
|
||||
if err != nil || cmd == command.RootCmd {
|
||||
originalArgs := expandedArgs
|
||||
expandedArgs, err = command.ExpandAlias(os.Args)
|
||||
if err != nil {
|
||||
fmt.Fprintf(stderr, "failed to process aliases: %s\n", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
if hasDebug {
|
||||
fmt.Fprintf(stderr, "%v -> %v\n", originalArgs, expandedArgs)
|
||||
}
|
||||
}
|
||||
|
||||
command.RootCmd.SetArgs(expandedArgs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue