zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: kfogel@collab.net
Cc: dev@subversion.tigris.org, zsh-workers@sunsite.dk
Subject: Re: subversion and programmable completion
Date: Mon, 21 Jul 2003 18:48:02 -0400	[thread overview]
Message-ID: <20030721224802.GA7569@acolyte.scowler.net> (raw)
In-Reply-To: <85fzkznc6y.fsf@newton.ch.collab.net>

> What's not machine parseable about the current output?

The zsh completion function basically does the following:

To find out what subcommands are available, run 'svn help',
and grab everything between 'Available subcommands:' and
'Subversion is a tool for revision control.'  Subcommands
listed in parentheses are aliases to the word before the
parentheses.

For subcommands, run 'svn help <subcommand>', grab the
'usage:' line, check for the presence of 'URL' or 'PATH' on
that line, and try to complete URLs or files and directories, 
respectively, as well as the options listed after 'Valid options:'
(where options in brackets are aliases to the options outside).

There is a similar process for svnadmin.

There are several problems with this scheme:

It doesn't handle multiple usage possibilities.  For example,
usage: switch URL [PATH]   or
       switch --relocate FROM TO [PATH ... ]

usage: 1. diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH ...]
       2. diff -r N:M URL
       3. diff [-r N[:M]] URL1[@N] URL2[@M]

This could be solved with some more intelligent parsing.

It doesn't handle know whether or not PATH refers to files in the
repository (as in svn diff), files not yet in the repository (as in
svn add), or something else.  This could be solved with some
hardcoding in the completion function.

It doesn't know what 'arg' refers to in '-r arg', '--username arg',
'--password arg', and so on.  This could be solved with some hardcoding
in the completion function.

If the subversion help output ever is altered so that the heuristics
fail, completion will break.


None of this is a problem (other than lack of man-hours), but if svn were
to actively participate in its own command completion, I think it would be
more efficient and less error-prone.


  reply	other threads:[~2003-07-21 22:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-20 16:27 Clint Adams
2003-07-21 15:15 ` kfogel
2003-07-21 22:48   ` Clint Adams [this message]
2003-07-21 18:33 ` Sebastien Cevey
2003-07-21 22:52   ` Clint Adams
2003-07-23 19:31   ` [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion] Julian Foad
2003-07-23 21:27     ` Philip Martin
2003-07-24  1:29       ` Julian Foad
2003-07-24  5:46         ` Philip Martin
2003-08-18  9:24         ` Roman Neuhauser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030721224802.GA7569@acolyte.scowler.net \
    --to=clint@zsh.org \
    --cc=dev@subversion.tigris.org \
    --cc=kfogel@collab.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).