[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn usage text

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2000-10-14 04:52:20 CEST

Bruce, et al., don't know if you intended that just to be a simple
example of using AutoOpt, or also an start on the actual Subversion
options. If the latter, then:

Note that not every long option needs a corresponding short option.
Let's be conservative with that single-letter namespace, we may need
it someday! :-) I'm thinking particularly of "--xml-file", but there
may be other things that want only a long option.

Also, is "-s"/"--ancestor-path" ever necessary? In CVS it's not,
iirc, because the repos path is instead a full-fledged argument (to
checkout or update or whatever). I would expect Subversion to work
out the same way.

And of course, every option needs to know whether it is a global
option or command option (in the CVS sense). The same option letter
or string may behave differently in the global context vs the command
context. I don't know if AutoOpt will help keep them separate. Under
a getopt() scheme, I would imagine re-invoking getopt after the
command name is seen, with a diminished argc and adjusted argv.

The option parsing for the client is going to require a lot of thought
to get right (or so I am expecting), so don't be shocked if you find
yourselves spending a surprising amount of time and discussion on it.

Best,
-K

Bruce Korb <bkorb@cruzio.com> writes:
> This is a multi-part message in MIME format.
> --------------4ADD54C6BE886B9B1C91DDBC
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
>
> For your (possible) amusement, attached is the
> option definition file that can be used to generate
> a program that produces this usage text (and processes
> the options, too). It also might make the AutoOpts
> pages more comprehensible?
>
>
> svn - Subversion - Ver. Fri Oct 13 18:31:37 PDT 2000
> USAGE: svn [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
> <command> [ <cmd-specific-opts> ... ] [ <cmd-args> ]
> Flg Arg Option-Name Description
> -x YES xml-file XML Interfacing file
> -d YES target-dir destination directory
> -s YES ancestor-path source directory
> -r YES revision Specified revision
> -f no force force action to be taken
> -v opt version Output version information and exit
> -? no help Display usage information and exit
> -! no more-help Extended usage information passed thru pager
>
> Options may be specified by doubled hyphens and their name
> or by a single hyphen and the flag character/option value.
>
> WHERE: ``<command>'' may be any of:
>
> checkout update add delete commit
>
> or their aliases. For specific help on one of these commands,
> use ``--help'' as a command specific option.
> --------------4ADD54C6BE886B9B1C91DDBC
> Content-Type: text/plain; charset=us-ascii;
> name="clopts.def"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
> filename="clopts.def"
>
> /* -*- Mode: text -*- */
>
> AutoGen Definitions options;
>
> prog_name = svn;
> prog_title = Subversion;
> argument = "<command> [ <cmd-specific-opts> ... ] [ <cmd-args> ]";
> long_opts;
> version = `date`;
> rcfile = "$$/../share/svn/svnrc",
> "$HOME", ".";
>
> test_main = yes;
>
> copyright = {
> date = 2000;
> owner = CollabNet;
> type = bsd;
> author = "Karl Fogel, et. al.";
> };
>
> explain =
> "WHERE: ``<command>'' may be any of:
>
> checkout update add delete commit
>
> or their aliases. For specific help on one of these commands,
> use ``--help'' as a command specific option.";
>
> flag = {
> name = xml_file;
> value = x;
> descrip = "XML Interfacing file";
> flag_arg = ":";
> };
>
> flag = {
> name = target_dir;
> value = d;
> descrip = "destination directory";
> flag_arg = ":";
> };
>
> flag = {
> name = ancestor_path;
> value = s;
> descrip = "source directory";
> flag_arg = ":";
> };
>
> flag = {
> name = revision;
> value = r;
> descrip = "Specified revision";
> flag_arg = ":";
> };
>
> flag = {
> name = force;
> value = f;
> descrip = "force action to be taken";
> };
>
> --------------4ADD54C6BE886B9B1C91DDBC--
Received on Sat Oct 21 14:36:11 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.