Make gflags and boost::program_options play nice with each other
authorTudor Bosman <tudorb@fb.com>
Thu, 23 Jul 2015 14:30:41 +0000 (07:30 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Thu, 23 Jul 2015 15:22:14 +0000 (08:22 -0700)
commit838cf14637f0c50fd8596a3de50c0fe79ab21735
tree8e9cd2f2ba9c9082ca1aa431934d0e2d3367f77f
parent7334598fed1fa92effebc904ec2a44d7e800c2b6
Make gflags and boost::program_options play nice with each other

Summary: GFlags is useful for global program options. boost::program_options makes it
easier to write command-line utilities. They don't, unfortunately, play
very nicely with each other.

Add a addGFlags() function to convert all GFlags to boost::program_options
options; you can then use boost::program_options::parse_command_line() to
parse all arguments, GFlags or not.

Also add a helper function to make parsing nested command lines easier.

Reviewed By: @fugalh

Differential Revision: D2215285
folly/Makefile.am
folly/configure.ac
folly/experimental/ProgramOptions.cpp [new file with mode: 0644]
folly/experimental/ProgramOptions.h [new file with mode: 0644]
folly/experimental/test/ProgramOptionsTest.cpp [new file with mode: 0644]
folly/experimental/test/ProgramOptionsTestHelper.cpp [new file with mode: 0644]
folly/m4/ax_boost_program_options.m4 [new file with mode: 0644]