[Bash-completion-devel] Bug#628123: Bug#628123: bash-completion: Add cd for longopt completion

Luca Bruno lethalman88 at gmail.com
Mon May 30 20:15:11 UTC 2011

On Mon, May 30, 2011 at 09:28:16PM +0300, Ville Skyttä wrote:
> On 05/27/2011 03:46 PM, Luca Bruno wrote:
> > I'd like to ask for adding "cd" to the list of commands such that _longopt
> > is used: complete -F _longopt -o default cd
> Simply doing that would break the $CDPATH completion we currently have
> for cd.  And _longopt isn't really the right thing to do as AFAIK cd
> does not have any long options.

I feared it wasn't the right way, it's just that adding that line makes it
work, as an hint for a possible fix.

> I'm not sure I understand correctly what you're looking for (please post
> a complete example if my guess is not correct), but it does complete
> variable names for me.
> $ export mydir=/tmp
> $ cd $my<TAB> # completes to "cd $mydir"

$ export mydir=/tmp
$ cd $mydir/<TAB> # should complete to cd /tmp/, just like for the ls command

http://www.debian.org - The Universal Operating System

More information about the Bash-completion-devel mailing list