|
|
|
@ -243,10 +243,10 @@ func (x *Cmd) Run() {
|
|
|
|
|
|
|
|
|
|
x.cacheSections()
|
|
|
|
|
|
|
|
|
|
// resolve Z.Aliases (if completion didn't replace them)
|
|
|
|
|
// resolve Z.Shortcuts (if completion didn't replace them)
|
|
|
|
|
if len(os.Args) > 1 {
|
|
|
|
|
args := []string{os.Args[0]}
|
|
|
|
|
alias := Aliases[os.Args[1]]
|
|
|
|
|
alias := Shortcuts[os.Args[1]]
|
|
|
|
|
if alias != nil {
|
|
|
|
|
args = append(args, alias...)
|
|
|
|
|
args = append(args, os.Args[2:]...)
|
|
|
|
@ -263,7 +263,7 @@ func (x *Cmd) Run() {
|
|
|
|
|
// find the leaf command
|
|
|
|
|
lineargs := ArgsFrom(line)
|
|
|
|
|
if len(lineargs) == 2 {
|
|
|
|
|
list = append(list, maps.KeysWithPrefix(Aliases, lineargs[1])...)
|
|
|
|
|
list = append(list, maps.KeysWithPrefix(Shortcuts, lineargs[1])...)
|
|
|
|
|
}
|
|
|
|
|
cmd, args := x.Seek(lineargs[1:])
|
|
|
|
|
|
|
|
|
@ -273,7 +273,7 @@ func (x *Cmd) Run() {
|
|
|
|
|
list = append(list, Comp.Complete(cmd, args...)...)
|
|
|
|
|
}
|
|
|
|
|
if len(list) == 1 && len(lineargs) == 2 {
|
|
|
|
|
if v, has := Aliases[list[0]]; has {
|
|
|
|
|
if v, has := Shortcuts[list[0]]; has {
|
|
|
|
|
fmt.Println(strings.Join(EscAll(v), " "))
|
|
|
|
|
Exit()
|
|
|
|
|
return
|
|
|
|
|