On Tue, Jun 12, 2012 at 10:26:45PM +0200, Johannes Hofmann wrote:
geometry.diff fixes --geometry flag
Fixed --geometry flag. It is --geometry in man page but -geometry in usage and only -geometry is recognized by program.
I'm not sure here. -geometry seems to be somewhat standard [1] and I don't want to break people's scripts etc without very good reason. So for now I adjusted the man page.
It is standard for traditional X applications (xclock, xterm etc.) to have only "long" options that start with one dash together with corresponding resource. Standard X tools mostly use XrmParseCommand [1] and you can see examples of options that start with one dash in Xlib documentation. I would even remove short options (like -v) and replace them with standard long options such as -version, but I guess you don't want to break compatibility for it.
getcmdoption.diff simplifies getCmdOption
Simplified getCmdOption. Removed State enum, it was overkill. It is also possible to remove support for mandatory arguments (opt_argc < 0) as it is not used, but it does not add LOC so I left it there.
Hm, if the patch would fix some bug - even some minor stuff - I would commit it together with the cleanup, but not just for the reduced LOC. Any other takers?
Now it looks like someone started writing a state machine for option parsing but then created a separate function for parsing just one option. Or maybe it is copied from legacy code. I will keep it until I find some related bug then, but IMO it is not good to mix cleanup with bugfixes (and it is not good to mix different patches in one in general). [1] http://www.tronche.com/gui/x/xlib/resource-manager/XrmParseCommand.html