git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] gitopt - command-line parsing enhancements
@ 2006-05-09  5:06 Eric Wong
  2006-05-09  5:06 ` [PATCH 1/6] gitopt: a new command-line option parser for git Eric Wong
  2006-05-09  8:35 ` [PATCH/RFC] gitopt - command-line parsing enhancements Junio C Hamano
  0 siblings, 2 replies; 22+ messages in thread
From: Eric Wong @ 2006-05-09  5:06 UTC (permalink / raw)
  To: git


Here's my take at a new command-line option parser to reduce wear on my
fingers.  It handles both long and short options, permuting, automatic
abbreviations, required arguments, optional arguments, and bundling.

It doesn't use getopt or argp, so it should be easily portable to
non-GNU systems (and only uses git-isms trivially, so other programs can
use it easily, too).

I've tested everything lightly but it seems to be working well.  The
unit test was very helpful throughout.
More intensive testing, bugfixes and comments would be greatly
appreciated.

It should be pretty easy to convert other git-* programs to use gitopt,
and write shell wrappers for git.c like I did with am/checkout/commit.
I'll probably do so in a few days once my fingers recover a bit, of
course feedback and patches for bug reports/enhancements are encouraged,
too.

1 - gitopt: a new command-line option parser for git
	This adds the parser, tests, and some simple changes to
	the git.c wrapper.

2 - update-index: convert to using gitopt
3 - ls-tree: convert to gitopt
4 - ls-files: convert to using gitopt
	These three are fairly straightforward conversions.
	I was somewhat disappointed that update-index didn't take
	kindly to permuting arguments, but it's also a good example
	how to disable permuting via gitopt: a == b

5 - gitopt: convert setup_revisions(), and diff_opt_parse()
	This is a fairly intrusive change that affects several
	important programs.  All the tests still pass, so it must be
	working :)

6 - commit: allow --pretty= args to be abbreviated
	This one isn't strictly dependent on gitopt, and can be
	trivially changed to work without the parent patches.

-- 
Eric Wong

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

end of thread, other threads:[~2006-05-11 20:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-09  5:06 [PATCH/RFC] gitopt - command-line parsing enhancements Eric Wong
2006-05-09  5:06 ` [PATCH 1/6] gitopt: a new command-line option parser for git Eric Wong
2006-05-09  5:06   ` [PATCH 2/6] update-index: convert to using gitopt Eric Wong
2006-05-09  5:06     ` [PATCH 3/6] ls-tree: convert to gitopt Eric Wong
2006-05-09  5:06       ` [PATCH 4/6] ls-files: convert to using gitopt Eric Wong
2006-05-09  5:06         ` [PATCH 5/6] gitopt: convert setup_revisions(), and diff_opt_parse() Eric Wong
2006-05-09  5:06           ` [PATCH 6/6] commit: allow --pretty= args to be abbreviated Eric Wong
2006-05-09  7:16           ` [PATCH 5/6] gitopt: convert setup_revisions(), and diff_opt_parse() Eric Wong
2006-05-11 20:19           ` Eric Wong
2006-05-09  9:08   ` [PATCH 1/6] gitopt: a new command-line option parser for git Timo Hirvonen
2006-05-09 12:58     ` Junio C Hamano
2006-05-09 19:39       ` Eric Wong
2006-05-09 19:18     ` Eric Wong
2006-05-09 20:10       ` Timo Hirvonen
2006-05-09 20:35         ` Junio C Hamano
2006-05-09 21:08           ` Timo Hirvonen
2006-05-09 21:11             ` Junio C Hamano
2006-05-09 21:31               ` Timo Hirvonen
2006-05-09  8:35 ` [PATCH/RFC] gitopt - command-line parsing enhancements Junio C Hamano
2006-05-09 19:48   ` Eric Wong
2006-05-09 20:28     ` Junio C Hamano
2006-05-09 21:14       ` Eric Wong

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