[Development] Qt Playground - Command Line Parser experiment

Hugo Parente Lima hugo.lima at openbossa.org
Thu Mar 15 14:08:19 CET 2012


On Thursday 15 March 2012 08:26:14 kai.koehne at nokia.com wrote:
> > -----Original Message-----
> > From: development-bounces+kai.koehne=nokia.com at qt-project.org
> > [mailto:development-bounces+kai.koehne=nokia.com at qt-project.org] On
> > Behalf Of ext Hugo Parente Lima
> > Sent: Thursday, March 15, 2012 12:16 PM
> > To: development at qt-project.org
> > Cc: Mark Constable
> > Subject: Re: [Development] Qt Playground - Command Line Parser
> > experiment
> > 
> > On Thursday 15 March 2012 07:29:23 Mark Constable wrote:
> > > Any simple standard cli args parser included with Qt would be
> > > overwhelmingly better than none at all even if it's just -s shortops
> > > (/s for win) and worry about --longopts and tar-like variations for
> > > Qt6+. The simpler the better as long as it's universally available in
> > > qtcore, if possible, sooner than later.
> > 
> > Hmmm... ok, let's go again... should I elaborate this:
> > 
> > https://github.com/hugopl/qcmdlineparser
> > (git at github.com:hugopl/qcmdlineparser.git)
> > 
> > or just "git push origin :master" and forget about?
> > 
> > Some usage examples can be found on the small unit test:
> > 
> > https://github.com/hugopl/qcmdlineparser/blob/master/qcmdlineparsertes
> > t.cpp
> 
> I only checked the tests file, but it seems like you're going for the GNU
> style where options following '-' are always one character letters.The Qt
> tools itself do not follow this style, e.g. qmake -project, not qmake
> --project, or qmake -p :) To use the parser also internally , it should
> IMO also support a style where '-help' is one valid argument.

It already accepts and there are tests for it, the default "auto-help" adds a 
"--help" and "-h", but can easily add a "-help" too.

The translation of "-" into "/" on Windows isn't done but is easy to do.
 
> Just my 2 cents
> 
> Kai

-- 
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120315/f25b07c6/attachment.sig>


More information about the Development mailing list