zsh-users
 help / color / mirror / code / Atom feed
* do not add a space after completion
@ 2009-06-14  7:26 Eric Smith
  2009-06-14 16:03 ` Bart Schaefer
  2009-06-23 14:26 ` invoking compadd so that completion is for the second argument Eric Smith
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Smith @ 2009-06-14  7:26 UTC (permalink / raw)
  To: zsh-users

I have a completion function that when executed should supply
no extra space after the option is given (on pressing <tab>).

Ideally it should append an underscore instead.

How would I achieve that (just for this function and not globally)?

thanks.

-- 
- Eric Smith


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: do not add a space after completion
  2009-06-14  7:26 do not add a space after completion Eric Smith
@ 2009-06-14 16:03 ` Bart Schaefer
  2009-06-21 10:23   ` Eric Smith
  2009-06-23 14:26 ` invoking compadd so that completion is for the second argument Eric Smith
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2009-06-14 16:03 UTC (permalink / raw)
  To: zsh-users

On Jun 14,  9:26am, Eric Smith wrote:
}
} I have a completion function that when executed should supply
} no extra space after the option is given (on pressing <tab>).
} 
} Ideally it should append an underscore instead.

When calling compadd, pass the -S option and possibly the -r option.
There is a partial example under the -r option description in the
manual.  For your specific case, probably you want:

    compadd -S _ -r '_ \t\n' ...

(replacing "..." with other options and potential matches, etc.)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: do not add a space after completion
  2009-06-14 16:03 ` Bart Schaefer
@ 2009-06-21 10:23   ` Eric Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Smith @ 2009-06-21 10:23 UTC (permalink / raw)
  To: zsh-users

Brilliant, thanks a lot Bart


-- 
- Eric Smith
Bart Schaefer said:
> On Jun 14,  9:26am, Eric Smith wrote:
> }
> } I have a completion function that when executed should supply
> } no extra space after the option is given (on pressing <tab>).
> } 
> } Ideally it should append an underscore instead.
> 
> When calling compadd, pass the -S option and possibly the -r option.
> There is a partial example under the -r option description in the
> manual.  For your specific case, probably you want:
> 
>     compadd -S _ -r '_ \t\n' ...
> 
> (replacing "..." with other options and potential matches, etc.)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* invoking compadd so that completion is for the second argument
  2009-06-14  7:26 do not add a space after completion Eric Smith
  2009-06-14 16:03 ` Bart Schaefer
@ 2009-06-23 14:26 ` Eric Smith
  2009-06-23 15:11   ` Bart Schaefer
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Smith @ 2009-06-23 14:26 UTC (permalink / raw)
  To: zsh-users

I want to set up completion rules for the second argument
and not the first which appears to eb the default.

How would i do this?

Thanks

-- 
- Eric Smith


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: invoking compadd so that completion is for the second argument
  2009-06-23 14:26 ` invoking compadd so that completion is for the second argument Eric Smith
@ 2009-06-23 15:11   ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2009-06-23 15:11 UTC (permalink / raw)
  To: zsh-users

On Jun 23,  4:26pm, Eric Smith wrote:
}
} I want to set up completion rules for the second argument
} and not the first which appears to eb the default.
} 
} How would i do this?

Could you provide an example command line to illustrate what you
intend to have happen?

For example, given a command line such as:

% roger dodger codger

Do you mean:

(1) The completion for "roger" is invoked, but the set of matches for
    "codger" is not the same as the set of matches for "dodger"; or

(2) The completion for "dodger" should be invoked (as if "roger" were
    not present) in order to generate matches for "codger"; or

(3) Some other thing entirely.

If (1), the best answer may be different if the matches for "codger"
are purely based on its position on the command line, or if they may
depend on what appears as the word in the "dodger" position.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-23 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-14  7:26 do not add a space after completion Eric Smith
2009-06-14 16:03 ` Bart Schaefer
2009-06-21 10:23   ` Eric Smith
2009-06-23 14:26 ` invoking compadd so that completion is for the second argument Eric Smith
2009-06-23 15:11   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).