[Tile-serving] [openstreetmap/osm2pgsql] osm2pgsql accepts multiple conflicting arguments (#142)

Jochen Topf notifications at github.com
Fri Jun 30 15:16:24 UTC 2023


As @pnorman mentioned many years ago we should switch to a better command line option parsing library to solve this. I see two real options:
* [Boost Program Options](https://www.boost.org/doc/libs/1_82_0/doc/html/program_options.html)
* [CLI11](https://github.com/CLIUtils/CLI11)

I have looked at many other options and used some of them, but they are either not powerful enough, not well maintained or not widely available in packages.

I have used Boost Program Options in other programs and am not really happy, the functionality is good, but the syntax is verbose and very hard to read. CLI11 looks better in that regard but I have only played around with it a bit, not really used it. But "The Internet" seems to be [quite happy with it]( 
https://www.reddit.com/r/cpp/comments/wxl5kd/cli11_is_making_all_the_other_options_libraries/).

As far as I can see, the largest downside of CLI11 is that it is another new dependency, the boost dependency we have anyway. On the other hand, the boost program options library is a compiled library while CLI11 is header only, so somewhat easier to install. (This doesn't matter currently, because we use other Boost libraries that are not header only, but medium term we should be able to get rid of boost system and boost filesystem (because those things are available in modern C++ std libs) and leaves only header-only boost components.

There is a good comparison of boost po and CLI11 here: https://iscinumpy.dev/post/comparing-cli11-and-boostpo/



-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/142#issuecomment-1614803835
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/issues/142/1614803835 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230630/0c2bff8f/attachment.htm>


More information about the Tile-serving mailing list