Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

XML completion for commands w/subcommands



I've made some changes to the help2simple.pl script and the simple
(probably should come up with a real name) xml format to deal with
commands that have subcommands (e.g. cvs).  The long xml format
could already deal with subcommands, but the long format is fairly
inaccessible.

To show how it works, I created a completion function for Tom Lord's
arch SCM tool, which was recently released (URLs at end).  The
_larch completion function is a reasonable working rough draft.
This is nice since it was generated by converting from the command help.
(The command help had to be tweaked by a perl s/// to get it in a format
understood by help2simple.pl).  The completion
function doesn't handle arguments to the subcommands, since I don't
really provide a good mechanism for automatically determining command line
args.  At some point will need some code to parse "usage:" lines.
Though the hard part is still  to write the functions that complete
options to flags or args.

It shouldn't be too hard to create similar functions for other scm tools like
bitkeeper, perforce, subversion, etc.  The page describing what I did are
listed on:
	http://www.geocities.com/f_rosencrantz/larch_generation.htm
And the main page:
	http://www.geocities.com/f_rosencrantz/xml_completion.htm 


The download contains the _larch completion function along with the perl script
and xsl scripts.

-FR.
p.s. I'm actually not familiar with arch.  I wanted the _larch function to help
learn it.

URLs:  Arch program -- http://regexps.com/#arch

Slashdot post on arch - http://slashdot.org/article.pl?sid=02/02/05/2155215



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/



Messages sorted by: Reverse Date, Date, Thread, Author