An extension of clojure.tool.cli to simplify command line parsing.
An extension of clojure.tool.cli to simplify command line parsing.
(add-action cli key-vector)
Put the parsed options into the tree.
Put the parsed options into the tree.
(add-default-globals cli options)
add the global options (--version --help) in.
add the global options (--version --help) in.
(add-parsed-options cli options key-vector)
Put the parsed options into the tree.
Put the parsed options into the tree.
(change-usage cli usage-function)
Set your own usage function if you really want to.
Set your own usage function if you really want to.
(do-parse args
parse-group
{:keys [pname version description exception]
:or {pname "test"
version "1.0.0"
description "This test program does nothing."
exception :none}})
(error-exit cli errors)
Set the proper error message and throw an exception.
Set the proper error message and throw an exception.
(error-msg cli errors)
Build a nice error message.
Build a nice error message.
(exit-condition cli group-name parser options errors & rest)
Check for errors, --version and --help. If any of the above do the right thing and throw an exception
Check for errors, --version and --help. If any of the above do the right thing and throw an exception
(exit-on-exception cli setting)
Set behavior to system exit on error, help or version. true or nil.
Set behavior to system exit on error, help or version. true or nil.
(help-header cli)
Build the program's help header.
Build the program's help header.
(help-summary cli)
Create a summary of the command line for the program.
Create a summary of the command line for the program.
(help-tree-entry name parse-entry)
create a help tree node from a parse tree node.
create a help tree node from a parse tree node.
(help-tree-group parse-group)
process the entries in a parse group to create help nodes.
process the entries in a parse group to create help nodes.
(new-cli name version description)
Initialize the command line interface map.
Initialize the command line interface map.
(new-main-parser cli options parse-groups)
Create the main cli parser
Create the main cli parser
(on-exception cli setting)
Set behavior for exception handling. :exit :throw or :none. Behavior applies to --help, --version and errors.
Set behavior for exception handling. :exit :throw or :none. Behavior applies to --help, --version and errors.
(parse cli argv)
Parse the arguments and fill in the cli map. Handle --help, --version and parsing errors.
Parse the arguments and fill in the cli map. Handle --help, --version and parsing errors.
(parse-group cli key-vector parse-group arguments)
Iterate over a parse group and parse the options and sub-parse-groups.
Iterate over a parse group and parse the options and sub-parse-groups.
(parse-group-entries cli key-vector parsers arguments)
loop through non sub-command group of parser entries.
loop through non sub-command group of parser entries.
(parse-group-entry cli key-vector group-name parser arguments)
Parse argumens with an entry from parse-group for its options and recurse through it's parse-groups.
Parse argumens with an entry from parse-group for its options and recurse through it's parse-groups.
(parse-options cli key-vector argv options group-name parser)
Parse the options for the current parser.
Parse the options for the current parser.
(throw-on-exception cli setting)
Set behavior to throw exception on error, help or version. true or nil.
Set behavior to throw exception on error, help or version. true or nil.
(unrecognized-options cli argv)
When we have leftovers.
When we have leftovers.
(usage cli summary group-name parser)
Basic help for the program.
Basic help for the program.
(usage-exit cli)
(usage-exit cli summary)
(usage-exit cli group-name parser summary)
Set the proper usage message and throw an exception.
Set the proper usage message and throw an exception.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close