{"repo":"mdub/clamp","free":true,"listed":false,"github":"https://github.com/mdub/clamp","clone":"git clone https://github.com/mdub/clamp.git","description":"a Ruby command-line application framework","language":"Ruby","stars":447,"topics":["ruby","command-line-parser","command-line"],"license":"MIT","category":"cli-tools","readme_excerpt":"Clamp \"Clamp\" is a minimal framework for command-line utilities. It handles boring stuff like parsing the command-line, and generating help, so you can get on with making your command actually do stuff. Not another one! Yeah, sorry. There are a bunch of existing command-line parsing libraries out there, and Clamp draws inspiration from a variety of sources, including [Thor], [optparse], and [Clip]. In the end, though, I wanted a slightly rounder wheel. (Although, Clamp has a lot in common with Ara T. Howard's [main.rb]. Had I been aware of that project at the time, I might not have written Clamp.) [optparse]: http://ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html [Thor]: http://github.com/wycats/thor [Clip]: http://clip.rubyforge.org/ [main.rb]: https://github.com/ahoward/main Quick Start A typical Clamp script looks like this: Internally, Clamp models a command as a Ruby class (a subclass of Clamp::Command ), and a command execution as an instance of that class. The example above is really just syntax-sugar for: Class-level methods like option and parameter declare attributes, in a similar way to attr accessor , and arrange for them to be populated automatically based on command-line arguments. They are also used to generate help documentation. There are more examples demonstrating various features of Clamp [on Github][examples]. [examples]: https://github.com/mdub/clamp/tree/master/examples Declaring options Options are declared using the option method. The three requir","default_branch":null,"files":null,"tree":[],"storefront":"/r/mdub","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mdub/clamp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}