{"repo":"leejarvis/slop","free":true,"listed":false,"github":"https://github.com/leejarvis/slop","clone":"git clone https://github.com/leejarvis/slop.git","description":"Simple Lightweight Option Parsing - ✨ new contributors welcome ✨","language":"Ruby","stars":1126,"topics":["command-line","option-parser","simple","easy-to-use","ruby","beginner-friendly"],"license":"MIT","category":"cli-tools","readme_excerpt":"Slop - Simple, Lightweight Option Parser ======================================== Slop is a simple option parser with an easy to remember syntax and friendly API. Installation ------------ gem install slop Usage ----- Note that the block we've added to the --version flag will be executed during parse time. Therefore these blocks should be reserved for immediately reacting to the presence of a flag. If you want to access other options or mutate values, check out the \"Custom option types\" section below and implement the #finish method. Option types ------------ Built in Option types are as follows: You can see all built in types in slop/types.rb . Suggestions or pull requests for more types are welcome. Advanced Usage -------------- This example is really just to describe how the underlying API works. It's not necessarily the best way to do it. Arguments --------- It's common to want to retrieve an array of arguments that were not processed by the parser (i.e options or consumed arguments). You can do that with the Result#arguments method: This is particularly useful when writing scripts with ARGF : Arrays ------ Slop has a built in ArrayOption for handling array values: If you want to disable the built-in string-splitting, set the delimiter to nil . Custom option types ------------------- Slop uses option type classes for every new option added. They default to the NullOption . When you type o.array Slop looks for an option called Slop::ArrayOption . This class must contain at","default_branch":null,"files":null,"tree":[],"storefront":"/r/leejarvis","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/leejarvis/slop/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."}