help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Command completion for an alias


From: Eduardo A . Bustamante López
Subject: Re: [Help-bash] Command completion for an alias
Date: Sat, 30 May 2015 12:01:17 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, May 30, 2015 at 02:15:45PM +0200, address@hidden wrote:
> Hi folks!
> 
> My .bashrc defines some aliases like alias gs='git status'. I'd like to
> enable command completion for aliases so that when the command line is (| is
> the cursor):

Bash provides the completion's mechanism, but the actual code that knows how to
complete certain commands is external. The most common package providing these
is bash-completion (https://bash-completion.alioth.debian.org/).

There is a fundamental problem with what you request though. Alias are simple
text substitutions that can expand to anything. If you have:

sc=status
alias gs='git "$sc"'

Then, is this new feature that you propose supposed to somehow evaluate the
code and determine that you're completing 'git status'?

-- 
Eduardo Bustamante
https://dualbus.me/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]