Patch to add argument parsing classes to gdb

Robert Lupton the Good rhl@astro.princeton.edu
Fri Nov 11 19:38:00 GMT 2011


Dear GDB,

I'm attaching a patch that implements two classes, GdbOptionParser and GdbArgumentParser, which are built around python's standard optparse and argparse but play well with gdb (e.g. don't call exit if you make a typo or ask for help!).  The code imports with python >= 2.3, but only provides the argparse-based parser if you actually have argparse in your path (python == 2.7?).

The patch:
	Implements the classes
	Adds docs
	Adds test cases

What else do you need to get this into the source tree?  I'm not sure how to deal with copyright assignment.  

The patch comes from cvs, so I could just check it in, given the magic handshake, but I suspect that that's not the way you do things.  In git/hg I could issue a pull request...

						R

P.S. Tom: this supersedes the patch I sent you a yesterday ago, and handles --help better

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rhl.argumentParsing.patch.2
Type: application/octet-stream
Size: 27314 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20111111/16e781c7/attachment.obj>
-------------- next part --------------




More information about the Gdb mailing list