{
    "componentChunkName": "component---src-templates-blog-post-tsx",
    "path": "/blog/2010-11-14-we-must-come-together-to-honor-the-command-line/",
    "result": {"data":{"blogPost":{"title":"We must come together to honor the command line","slug":"/blog/2010-11-14-we-must-come-together-to-honor-the-command-line/","authorNodes":[{"name":"Charles Lowell","slug":"/people/charles-lowell/"}],"markdown":{"html":"<p>I reap no joy from writing command line interfaces in Ruby, and about 5 minutes before leaving RubyConf this year I realized that I am not alone.</p>\n<p>It's not angst I feel so much as a general <em>\"meh\"</em>: There's a fairly decent out-of-the-box way to do it in <code class=\"language-text\">OptionParser</code>, but the minute you want to introduce commands is when the muddling begins. Sure you can see\nyour way through it, but it's never robust and you always get smacked in the ass by the edge cases that\ninevitably come along.</p>\n<h2 id=\"it-aint-for-lack-of-trying\" style=\"position:relative;\"><a href=\"#it-aint-for-lack-of-trying\" aria-label=\"it aint for lack of trying permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>It ain't for lack of trying</h2>\n<p>My own abortive attempts not withstanding, I've tried in the last year at least 3 different libraries for parsing CLI options in my applications and gems. These are\n<a href=\"http://github.com/davetron5000\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">gli</a>, <a href=\"http://github.com/wycats/thor\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">thor</a> and <a href=\"http://github.com/joshbuddy/optitron\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">optitron</a>. I have known and loved each of these libraries in its own way, but ultimately all of them left me feeling unsatisfied. I won't go into my specific dissatisfactions with each here, but suffice it to say that my malaise was shared. The general consensus of the\ncohort at the bar was that despite the recent innovations and improvements in the space, we'd really have just been better off with\n\"<code class=\"language-text\">OptionParser</code> plus commands.\"</p>\n<h2 id=\"but-we-should-do-better\" style=\"position:relative;\"><a href=\"#but-we-should-do-better\" aria-label=\"but we should do better permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>But we should do better</h2>\n<p>Better off for sure, but is that still what we want: to just get by?</p>\n<p>No. we need a way to write command lines that feels like judo: deploying minimal force to effortlessly sling mountains of code.</p>\n<p>I say we can have our cake and eat it too. I say our command lines can be easy. I say our command lines can be sexy. I say our command lines can be so awesome that they crap rainbows and have herds of unicorns come thundering out of their asses.</p>\n<p>That's why I'm starting the <a href=\"http://github.com/cowboyd/optimal\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">optimal</a> project. It may lead to nothing. It might even lead eventually to some code... that's not the point right now though. The point is to reach out to everyone who feels strongly about this and ask them to contribute ideas and requirements in order to build a consensus on the next generation of CLI builder that everybody can be proud of.</p>\n<p>It certainly will not happen overnight, but for the betterment of all, it's high time to find the true successor to OptionParser: the one the community sees eventually integrated into the standard library.</p>","frontmatter":{"date":"November 14, 2010","description":null,"tags":["ruby"],"img":null}}}},"pageContext":{"id":"5cb64402-ea37-5297-b671-0204234d9d76"}},
    "staticQueryHashes": ["1241260443"]}