summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-08-02 17:59:24 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-08-02 17:59:24 +0100
commitee4fa13e7a2a043a2a4840b8f2e04f5742115d3e (patch)
treef90a0a0b4003b9ab7e93e11a2270027e2b70b17a /packaging
parent49114bb7af82dd73bfd482a8bbd5a135653ffcdf (diff)
downloadrabbitmq-server-git-ee4fa13e7a2a043a2a4840b8f2e04f5742115d3e.tar.gz
homemade opt parser
It's either this or ~400 lines of code from github under a non-standard license. The idea here is that you specify options with tuples like: - {flag, <flag string>}, or - {option, <option string>, <default value>}. Then, you let get_options separate the flags and options from the arguments. The spec for get_options is: get_options/2 :: ([{flag, string()} | {option, string(), any()}], [string()]) -> {[string()], [{string(), any()}]} For instance: get_options([{flag, "-q"}, {option, "-p", "/"}], ["set_permissions","-p","/","guest", "-q",".*",".*",".*"]) == {["set_permissions","guest",".*",".*",".*"], [{"-q",true},{"-p","/"}]}
Diffstat (limited to 'packaging')
0 files changed, 0 insertions, 0 deletions