support DEBUG when expanding aliases

This commit is contained in:
vilmibm 2020-05-27 23:28:26 -05:00
parent 52a02a7a4b
commit 8773a997ee

View file

@ -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)