Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion alias
- X-seq: zsh-workers 23235
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Completion alias
- Date: Fri, 23 Mar 2007 08:54:58 -0700
- In-reply-to: <200703231230.l2NCU0MS030229@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <joerg@xxxxxxxxxxxx> <200703230001.l2N013h0009082@xxxxxxxxxxxxxxxxx> <slrnf07brn.ist.joerg@xxxxxxxxxxxx> <200703231230.l2NCU0MS030229@xxxxxxxxxxxxxx>
On Mar 23, 12:29pm, Peter Stephenson wrote:
} Subject: Re: Completion alias
}
} =?UTF-8?Q?J=C3=B6rg?= Sommer wrote:
} > But how can I use this for a completion of a command with an argument,
} > i.e. agi should have the same completion as 'agt-get install'
}
} That would require some rewriting of _apt.
In this specific instance, if "agi" really is just shorthand for the
entirely equivalent "apt-get install", then:
alias agi='apt-get install'
unsetopt complete_aliases
I think it should also work to do
_agi () {
shift words
service=apt-get
words=(apt-get install $words)
((CURRENT++))
_apt
}
compdef _agi agi
However, there may be something else that needs to be twaddled as well
as service= and words= to guarantee that this works properly.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author