# HG changeset patch # User thomas_-_s # Date 1283843858 0 # Node ID fe50761a234fd2713eadf85c4eab681508ebc8d5 # Parent 3ee67782b40ae3dae2880803a79a84eb8b04bb95 Ensure correct command line parsing on Mac, because when opened with Finder, a curious argument starting with ^ will be added. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1010 59b1889a-e5ac-428c-b0c7-476e01d41282 diff -r 3ee67782b40a -r fe50761a234f src/tclap/CmdLine.h --- a/src/tclap/CmdLine.h Sun May 30 13:27:37 2010 +0000 +++ b/src/tclap/CmdLine.h Tue Sep 07 07:17:38 2010 +0000 @@ -458,6 +458,15 @@ if ( !matched && _emptyCombined( args[i] ) ) matched = true; +#ifdef __APPLE__ + // If we are running on Mac, opening an app with the finder + // adds a command line arg like this: -^G^Gn_0_516222. + // To avoid a CmdLineParseException set matched to true if + // the arg begines with ^. + if ( !matched && args[i].at(0) == '^' ) + matched = true; +#endif + if ( !matched && !Arg::ignoreRest() ) throw(CmdLineParseException("Couldn't find match " "for argument",