switch arg parser to cxxopts#604
Conversation
|
Thanks for drafting this PR, I'd like to move on with this as part of the release after v1.11. On the questions you raised:
Yep, that is really a debugging entry, that's why it is not actually documented as such. I guess we can always raise the question of optionally showing on the cxxopts repo, but no harm done if not possible.
That's an option, not sure what is the most readable/explicit between having everything straight into the main, or on the other hand having a dedicated placeholder for everything related to user input. In any case, we can always change that as another step, so let's stick to a simple replacement of the current behavior in this PR.
I agree versioning dependencies along with the core code for this repo is not ideal so the whole idea of submodules is appealing. On the other hand the current |
|
jep, agree on all points. will do a git submodule and leave the rest for now. skimming over some issues in cxxopts, I found out how to hide certain options, will implement that for the heuristic arg. |
for me this is done. no stress with a review. also needs some more testing, I just did example_2.json. would be good if you could eventually try this branch with your common arg combos @jcoupey |
|
Thanks @nilsnolde. I can't really commit to reviewing soon but I definitely want to include this early in the next iteration so we have plenty of time to test from |
|
yeah no worries, we're not depending on this, it has infinite time from our side:) |
jcoupey
left a comment
There was a problem hiding this comment.
I didn't spend much time testing so far but went through the changes and left a few comments.
|
@jcoupey addressed your comments for the most part. probably we don't get around turning off clang-format, but happy to see if you can verify/dismiss my thoughts locally. |
jcoupey
left a comment
There was a problem hiding this comment.
The overall changes look OK from what I can tell but I get puzzling results when running $ vroom -i docs/example_1.json
I sometimes get:
[Error] VROOM compiled without libosrm installed.
{"code":3,"error":"VROOM compiled without libosrm installed."}
while the error used to be about not being able to reach osrm-routed (maybe a change in default router).
Also I sometimes randomly get a segfault for that same command instead of the above error.
It appears that |
|
ok resolved the outstanding issues I hope. thanks @krypt-n , you're right of course. github seems to have a bug.. I can't comment on half of your review comments @jcoupey , so:
I checked a few commands and it worked fine for me now, in terms of examples only |
|
oh and still no formatting.. |
|
@jcoupey should we have another round so we can merge this? actually this is (kinda) blocking windows support in the python bindings as well (VROOM-Project/pyvroom#45). let me know if there's anything left to do and we can get it out of our heads:) |
|
Sorry, I've been taken by other stuff, and also a bit lazy on that one. You're right, let's get this done. I just did a round of command-line tests and everything seems OK, except for the debug The same works on |
|
Actually the exception is raised in |
|
turns out that's a bit of a tricky case.. since cxxopts reserves commas to split arguments, e.g. I had to change cxxopts |
|
There is yet another problem with multiple occurrences of the same flag. Say I have an instance with both The same kind of odd thing happens with
It looks like only the last flag occurrence is taken into account? |
|
Ah right totally never played around with the „new“ multi profile implementation. That’s right, it’s only one taken into account. I’ll change that. Is there any other flag that can be specified multiple times? |
No, only |
|
ok, that should've done it @jcoupey |
|
Thanks @nilsnolde for your work on this! I just made a couple adjustments on the clang-format side and took the opportunity for a bit of help rephrasing. |
fixes #602
I poc'd it real quick, it's definitely not tested yet, but you'll see the way it'd be implemented.
a few questions from my side:
heuristicarg is now showing onhelp, I guess that's mostly for you to debug? I can't see a way to hide it in cxxopts, but also don't think it's that bad it's showing nowCLArgsstruct or evencl_args.hand pull the stuff intomain.cpp? defaults are applied via cxxopts which is IMHO more idiomatic/expected. main is only passing single parameters to functions as far as I could see, so it wouldn't be a big change I think. anyways, that's maybe micro-"optimizing"..Tasks
docs/API.md(remove if irrelevant)CHANGELOG.md(remove if irrelevant)