{"id":32,"date":"2012-05-06T13:40:17","date_gmt":"2012-05-06T20:40:17","guid":{"rendered":"\/?p=32"},"modified":"2013-05-05T15:27:17","modified_gmt":"2013-05-05T22:27:17","slug":"dropt","status":"publish","type":"post","link":"https:\/\/www.slimjimmy.com\/weblog\/archives\/2012\/05\/06\/dropt\/","title":{"rendered":"dropt 1.1.0"},"content":{"rendered":"<p>I&#8217;m releasing <a href=\"http:\/\/www.taenarum.com\/software\/dropt\/\">dropt 1.1.0<\/a> today.<\/p>\n<p>dropt is a C library for parsing command-line options.  Yes, there are a lot of existing ones already, but I wasn&#8217;t satisfied with those that I had come across:<\/p>\n<p><!--more--><\/p>\n<ul>\n<li>getopt: The granddaddy of option parsers, getopt uses global variables with funny names and with confusing semantics.  There are <a href=\"http:\/\/www.gnu.org\/software\/libc\/manual\/html_node\/Getopt.html\">various<\/a> <a href=\"http:\/\/freegetopt.sourceforge.net\/\">implementations<\/a> <a href=\"http:\/\/www.chemie.fu-berlin.de\/chemnet\/use\/info\/libgpp\/libgpp_39.html\">of<\/a> <a href=\"http:\/\/www.codeproject.com\/Articles\/157001\/Full-getopt-Port-for-Unicode-and-Multibyte-Microso\">it<\/a> with different features, licensing terms, degrees of portability, and levels of quality.  getopt traditionally handles short and long options in a disjoint manner (if the implementation even handles both).<\/li>\n<li><a href=\"http:\/\/directory.fsf.org\/wiki\/Popt\">popt<\/a>: popt has a friendly license, but it has external dependencies (gettext).  It&#8217;s designed for POSIX systems (but is available on Windows as part of <a href=\"http:\/\/gnuwin32.sourceforge.net\/\">GnuWin32<\/a>).  It is feature-rich, but consequently I think that it&#8217;s overly complicated for typical needs.<\/li>\n<li><a href=\"http:\/\/code.google.com\/p\/getoptpp\/\">getoptpp<\/a>: This is C++-only and is licensed under the GPL.<\/li>\n<li><a href=\"http:\/\/www.boost.org\/doc\/libs\/1_43_0\/doc\/html\/program_options.html\">Boost.program_options<\/a>: This has friendly licensing terms, but it&#8217;s C++-only.<\/li>\n<li><a href=\"http:\/\/www.gnu.org\/software\/libc\/manual\/html_node\/Argp.html\">GNU argp<\/a> and the <a href=\"http:\/\/developer.gnome.org\/glib\/2.30\/glib-Commandline-option-parser.html\">glib GOption parser<\/a>: In truth, these might have satisfied me if I had been familiar with them years ago when I started work on dropt.  However, even as LGPL libraries, they&#8217;re still more restrictive than I like.<\/li>\n<\/ul>\n<p>dropt solves my complaints about portability, licensing, and hopefully ease-of-use.  It&#8217;s intentionally not feature-rich, but I think that it provides functionality suitable for most cases.<\/p>\n<p>Command-line option parsing has never been sexy, especially in this modern era of keyboard-less tablet computers, but if you happen to be writing an application that takes command-line options, perhaps give dropt some consideration.<\/p>\n<p>Feedback is appreciated as always.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m releasing dropt 1.1.0 today. dropt is a C library for parsing command-line options. Yes, there are a lot of existing ones already, but I wasn&#8217;t satisfied with those that I had come across:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}