[Bash-completion-devel] Get stuck

2011-05-23 Thread Igor Murzov
Hey! I get stuck trying to implement completion script for strings containing two parts for completion delimited by '%' sign. For example, `cmd opt%arg`. The problem is that, if i hit tab key, when cursor is behind delimeter, bash eats first part of string leaving `cmd arg`. I just can't unders

Re: [Bash-completion-devel] Get stuck

2011-05-23 Thread Ville Skyttä
On 05/23/2011 02:45 AM, Igor Murzov wrote: > Hey! I get stuck trying to implement completion script for strings containing > two parts for completion delimited by '%' sign. For example, `cmd opt%arg`. > The problem is that, if i hit tab key, when cursor is behind delimeter, bash > eats first pa

Re: [Bash-completion-devel] Get stuck

2011-05-23 Thread Raph
On Mon, May 23, 2011 at 03:45:39AM +0400, Igor Murzov wrote: > Hey! I get stuck trying to implement completion script for strings containing > two parts for completion delimited by '%' sign. For example, `cmd opt%arg`. > The problem is that, if i hit tab key, when cursor is behind delimeter, bas

Re: [Bash-completion-devel] Get stuck

2011-05-23 Thread Raph
On Mon, May 23, 2011 at 11:39:45PM +0300, Ville Skyttä wrote: > On 05/23/2011 02:45 AM, Igor Murzov wrote: > > Hey! I get stuck trying to implement completion script for strings > > containing > > two parts for completion delimited by '%' sign. For example, `cmd > > opt%arg`. > > The problem i

Re: [Bash-completion-devel] Get stuck

2011-05-23 Thread Raph
On Mon, May 23, 2011 at 10:57:14PM +0200, Raph wrote: [...] > I'm interested too in knowing how to deals with COMP_WORDBREAK, > (especially using properly the API) May be seen as a thread hijack but I think this is related: The attached completion, is the only way I found to have a consistent comp

Re: [Bash-completion-devel] Get stuck

2011-05-23 Thread Ville Skyttä
On 05/23/2011 11:57 PM, Raph wrote: > and I'm interested too in knowing how to deals with COMP_WORDBREAK, > (especially using properly the API) I think the API facilities we have for this are the -n arguments to _get_comp_words_by_ref and _init_completion. I don't claim to understand anywhere ne

Re: [Bash-completion-devel] Get stuck

2011-05-25 Thread Igor Murzov
В сообщении от 24 мая 2011 00:39:45 автор Ville Skyttä написал: > On 05/23/2011 02:45 AM, Igor Murzov wrote: > > Hey! I get stuck trying to implement completion script for strings > > containing two parts for completion delimited by '%' sign. For example, > > `cmd opt%arg`. The problem is that, if

Re: [Bash-completion-devel] Get stuck

2011-05-25 Thread Ville Skyttä
On 05/25/2011 11:52 AM, Igor Murzov wrote: > upgradepkg old_package_name%new_package_name > I want to handle this notation in completion. I need to complete filenames > and > directories after '%'. I wrote two variants of completion function, but none > of them works as expected. Actually, pr

Re: [Bash-completion-devel] Get stuck

2011-06-03 Thread Igor Murzov
В сообщении от 25 мая 2011 21:59:30 автор Ville Skyttä написал: > Maybe try to add % to it instead and see if that leads to something useful? > > $ bash --norc > $ echo "$COMP_WORDBREAKS" > > "'@><=;|&(: Adding % to COMP_WORDBREAKS indeed solves the issue. I suppose that applying Raphaël's patc

[Bash-completion-devel] Get stuck again

2011-11-13 Thread Igor Murzov
I can't understand how $COMP_WORDBREAKS works and why quotes on command line give such a weird result. Test function is following: -- _zz() { echo -e "\n* $COMP_CWORD:" for (( i=0; i <= COMP_CWORD; i++ )); do echo "[${COMP_WORDS[i]}]" done } && complete