mapbox / cpp

C++ @ Mapbox
108 stars 17 forks source link

Add recommendations for option parsing #35

Open springmeyer opened 7 years ago

springmeyer commented 7 years ago

In C++ my experience says:

/cc @GretaCB @joto @mapbox/core-tech @danpat

springmeyer commented 7 years ago

libraries to investigate:

joto commented 7 years ago

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.

joto commented 6 years ago

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.

springmeyer commented 6 years ago

Just learned from @kkaefer that mbgl is using https://github.com/Taywee/args for demo apps - which @brunoabinader brought in.

springmeyer commented 6 years ago

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.

joto commented 6 years ago

My experience with Clara so far:

Positive:

Negative:

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.)

springmeyer commented 6 years ago

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.