Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Argument "-o nospace" of compgen isn't work?

86 views
Skip to first unread message

yhun...@gmail.com

unread,
May 8, 2012, 12:17:08 AM5/8/12
to
Is argument "-o nospace" of compgen not work?

I write a simple script for auto-completion as following,
-------------
_cooltool()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -o nospace -W "fooOption barOption" -- $cur) )
}
complete -F _cooltool cooltool
-------------

When I type following command in terminal,
$ cooltool ba<tab>

It will become
$ cooltool barOption<space>|

However, I don't hope a space appear at end of line as following
The expected condition should be
$ cooltool barOption|

Is there something wrong for using of "compgen -o nospace" by me?
Do you all have any idea?

Thanks all.

0 new messages