{"repo":"lunarmodules/lua_cliargs","free":true,"listed":false,"github":"https://github.com/lunarmodules/lua_cliargs","clone":"git clone https://github.com/lunarmodules/lua_cliargs.git","description":"A command-line argument parsing module for Lua.","language":"Lua","stars":128,"topics":["cli","lua","cli-args","terminal","command-line"],"license":"MIT","category":"cli-tools","readme_excerpt":"lua cliargs cliargs is a command-line argument parser for Lua. It supports several types of arguments: 1. required arguments 2. optional arguments with different notations: -short-key VALUE and/or --expanded-key=VALUE 3. optional arguments with multiple-values that get appended to a list 4. optional \"flag\" arguments (on/off options) with notations: -short-key and/or --expanded-key 5. a single optional \"splat\" argument which can be repeated (must be the last argument) Optional arguments can have default values (strings), flags always default to 'true'. Usage Examples See the examples under the examples/ directory. API See http://lua-cliargs.netlify.com/ for the API docs. Help listings --help A help listing will be automatically generated and accessed using the --help argument. When such an option is encountered, cli:parse() will abort and return nil, string with the help message; you are free to print it to the screen using print() if you want. You can also force its display in the code using cli:print help() . This is the result for our example (see examples/00 general.lua ): Validations Runtime argument validation From a parsing point of view, there are 3 cases that need to be handled which are outlined below. If I missed something, please open a ticket! Missing a required argument Missing value for an optional argument Unknown arguments Some sanity guards In the following cases, cliargs will report an error to you and terminate the running script: 1. flag options can not ac","default_branch":null,"files":null,"tree":[],"storefront":"/r/lunarmodules","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lunarmodules/lua_cliargs/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."}