[Development] QCommandLineParser

David Faure david.faure at kdab.com
Thu Aug 1 11:02:22 CEST 2013


On Tuesday 30 July 2013 10:21:11 Saether Jan-Arve wrote:
> Hi.
> Although this is not necessary for 5.2, I have two feature requests:
> 
> 
> 1. Have support for "response files", (or @option-file as the moc patch
> calls it).
> 
> People shouldn't have to implement that for every tool that needs it, and
> all Qt based apps that needs response files should use_the_same_syntax.

95% of the QCommandLineParser users won't need this, it really only makes 
sense for compiler-like tools (e.g. moc), due to having a search path that can 
become quite long and hit limits (on Windows).

So while I'm not very strongly opposed to adding this (after 5.2), I also 
don't think it's essential to have.

> 2. Standardize value lists so that they work across shells
> 
> I.e. this doesn't work in all shells:
> 
> ./init-repository --module-subset=qtbase,qtsvg
> 
> Problem is that comma is an argument separator in MS Powershell, the result
> is that Powershell will effectively call the process with two arguments:
> 
> ./init-repository --module-subset=qtbase qtsvg

That's .... crazy :-)

> It would be great if QCommandLineParser could help people not to shoot
> themselves in the foot if they want to accept a list of values.

I don't intend to add workarounds for broken shells in QCommandLineParser.
If the user has to add quotes like Ben ("BRM") says, then that's what the 
solution is. Just like you can't pass a * sign to an app literally, you need 
to escape it or quote it. That's the user's job, not the parser's job, since 
the shell intervenes before the parser can do anything.

-- 
David Faure | david.faure at kdab.com | Managing Director KDAB France
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the Development mailing list