zsh-users
 help / color / mirror / code / Atom feed
* "Bookmarked" cvs repositories
@ 2006-11-03  5:57 Jean-Rene David
  2006-11-03 12:04 ` Roman Neuhauser
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Rene David @ 2006-11-03  5:57 UTC (permalink / raw)
  To: zsh-users

I would like to modify the completion of cvs'
'-d' option. I created an array like so:

repositories=( :ext:user@host:/path/to/cvs
               :ext:user@anotherhost:/path/to/cvs )

When I type:
cvs -d<TAB>

I would like zsh to offer those repositories for
completion.

I tried a few things but nothing I did seemed to
override the _cvs function that comes with the
distribution.

Sorry if this is trivial... 

-- 
JR


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

* Re: "Bookmarked" cvs repositories
  2006-11-03  5:57 "Bookmarked" cvs repositories Jean-Rene David
@ 2006-11-03 12:04 ` Roman Neuhauser
  0 siblings, 0 replies; 2+ messages in thread
From: Roman Neuhauser @ 2006-11-03 12:04 UTC (permalink / raw)
  To: zsh-users

# jrdavid@magma.ca / 2006-11-03 00:57:30 -0500:
> I would like to modify the completion of cvs'
> '-d' option. I created an array like so:
> 
> repositories=( :ext:user@host:/path/to/cvs
>                :ext:user@anotherhost:/path/to/cvs )
> 
> When I type:
> cvs -d<TAB>
> 
> I would like zsh to offer those repositories for
> completion.
> 
> I tried a few things but nothing I did seemed to
> override the _cvs function that comes with the
> distribution.
> 
> Sorry if this is trivial... 

    Well, looking at my 4.2.5/functions/Completion/Unix/_cvs
    I see that _arguments dispatches to _cvs_roots for the -d argument.
    The only obvious customization mechanisms I see there are the
    $CVS_PASSFILE variable or complete redefinition.

    (( $+functions[_cvs_root] )) ||
    _cvs_root() {
      local cvspassfile id slash
      
      typeset -gU _cvs_roots
      
      if [[ -f "${cvspassfile::=${CVS_PASSFILE:-$HOME/.cvspass}}" ]]; then
        if _cvs_loadstat; then
          id="$(LC_ALL=C builtin stat -g +mtime -F '%Y/%m/%d-%T' "$cvspassfile")"
        else
          id="$(LC_ALL=C ls -l "$cvspassfile")"
        fi
        if [[ "$id" != "$_cvs_pass_id" ]]; then
          slash=/
          _cvs_roots=($_cvs_roots ${${${${(f)"$(<$cvspassfile)"}#/1 }%% *}/:2401${slash}/:/})
          _cvs_pass_id="$id"
        fi
      fi
      
      _tags files && {
        compadd -M 'r:|[:@./]=** r:|=**' "$@" -a _cvs_roots || {
          compset -P ':(local|fork):'; _files "$@" -W / -/
        }
      }
    }


-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991


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

end of thread, other threads:[~2006-11-03 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-03  5:57 "Bookmarked" cvs repositories Jean-Rene David
2006-11-03 12:04 ` Roman Neuhauser

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).