Open springmeyer opened 7 years ago
libraries to investigate:
I usually just use getopt_long()
available in libc for simpler cases. The interface is C and not C++ and slightly ugly. But for many cases this is simple enough and doesn't require an extra dependency. If this is not enough it is time to switch to boost::program_options
anyway.
Something to investigate: Clara "A simple to use, composable, command line parser for C++ 11 and beyond". By the same guy who created the Catch unit test framework.
Just learned from @kkaefer that mbgl is using https://github.com/Taywee/args for demo apps - which @brunoabinader brought in.
watching progress on Clara at https://github.com/mapbox/vtzero/commit/70fc23278e45788bf4812cb22d888ea024dc9c65. I'm in support for having Clara be our recommendation if @joto's experience is solid this week in this port.
My experience with Clara so far:
Positive:
Negative:
-
char as parameter (often used to denote stdin) is not possible.I think it is too early to recommend this as a standard tool, but I think collecting some experience with it is probably a good idea. (That's why I went ahead and used it in the relatively simple vtzero examples.)
I think collecting some experience with it is probably a good idea. (That's why I went ahead and used it in the relatively simple vtzero examples.)
👍 looking forward to learning more as you use it.
In C++ my experience says:
/cc @GretaCB @joto @mapbox/core-tech @danpat