-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode 5 automatically adds -NSDocumentRevisionsDebugMode YES to end of args, which screws up the Catch arg parser #230
Comments
I'm not seeing any args being automatically added - are you sure you've not specified that in your scheme? As for it parsing into |
You probably need to use a project that is an OS X Cocoa app that uses documents, and in the scheme editor, have the "Allow debugging when using document Versions Browser" turned on. The arguments I specify in the scheme are "-b -d yes --out %stderr". |
Re: "project that is an OS X Cocoa app that uses documents" etc - fair enough. So Now the underlying issue is probably obfuscated a bit by something I can change. Unrecognised options are stored until the end of the parse (as what to do with them is decided externally). So the N, S and D are skipped over for now. Then it comes to So:
|
I've committed build 22 which has the changes I proposed in (2), above |
Cool. I'm on vacation for the rest of the year, so I'll take a look when I get back to it. We don't use the document revisions feature of Cocoa at this point, but certainly might in the future, in which case it might be necessary to use -NSDocumentRevisionsDebugMode. We should be able to filter out -NSDocumentRevisionsDebugMode at that time, but others might run into this same problem. It'd be nice if the parser could notice that the current token after the '-' (NSDocumentRevisionsDebugMode in this case) is not a collection of valid Catch options and just ignore it the entire thing. |
Can't you just use something like '--' or so and after that ignore all following arguments? E.g.: |
That's a good suggestion - and, now you mention it, I think I've seen similar in other libraries |
See e.g. Guideline 10 in POSIX.1-2008 Section 12.2 Utility Syntax Guidelines. |
... and was only a one line change - I've now committed it as build 23 |
It's also not uncommon to use '-' (dash) to designate standard input. This could be used with option -f, --input-file to load test names to run from a file or stdin. However, this remark doesn't really belong here ;-) |
I got the latest version to try, but had to make a bunch of changes to our project and some source files to build with C++0x turned on. Some std::string things are crashing when I do this, so I can't get far enough along to try your parsing changes. Just an FYI about using C++0x. |
I think this could be closed now... |
Thanks @Kosta-Github. However I'd somehow missed @sjmills last comment until now.
|
I haven't gotten back to looking at the C++11 problems because more important things always get in the way. But when I did check, I was able to use -- and have Catch ignore everything after that. So yeah, the original issue is closed. |
Thanks @sjmills. |
It keeps parsing through "NSDocumentRevisionsDebugMode" until it gets to 'o', which it thinks is the -o argument, then complains that 'c' isn't a valid argument or something like that. The user can temporarily work around this by turning off "Allow debugging when using document Versions Browser" in the Edit Scheme dialog.
The text was updated successfully, but these errors were encountered: