Liking cljdoc? Tell your friends :D

metav.cli.common


cli-optionsclj

source

error-msgclj

(error-msg errors)
source

exitclj

(exit {:keys [exit-message ok?]})

Function used to cleanly shutdown the program. Expect a map as an argument. Relevant keys are:

  • :ok?: a boolean from wich the status code is derived.
  • :exit-message: An optional message to display at the end of the program.
Function used to cleanly shutdown the program. Expect a map as an argument.
Relevant keys are:
- `:ok?`: a boolean from wich the status code is derived.
- `:exit-message`: An optional message to display at the end of the program.
sourceraw docstring

make-mainclj

(make-main validate-args-fn perform-command-fn)

Function helping in defining the main function of a program.

Parameters:

  • validate-args-fn: takes program arguments, parses and validates them.
  • args->context-fn: turn the parsed arguments into a metav context
  • perform-command-fn: function perfoming a metav command, takes a context as parameter.
Function helping in defining the main function of a program.

Parameters:
- `validate-args-fn`: takes program arguments, parses and validates them.
- `args->context-fn`: turn the parsed arguments into a metav context
- `perform-command-fn`: function perfoming a metav command, takes a context as parameter.
sourceraw docstring

make-validate-argsclj

(make-validate-args option-spec usage-fn)
(make-validate-args option-spec usage-fn cli-arguments->opts)

Makes a function that validates command line arguments. This function either return a map indicating the program should exit (with an error message, and optional ok status), or a map indicating the action the program should take and the options provided.

Parameters:

  • option-spec: clojure.tools.cli vector defining opts.
  • usage-fn: usage function employed to print a desctiption of the command.
  • args->opts: Function taking the result of clojure.tools.cli/parse-opts (parsed program arguments) and returning either a map containing the customarily verified arguments to be used by the program.
Makes a function that validates command line arguments. This function
either return a map indicating the program should exit
(with an error message, and optional ok status), or a map
indicating the action the program should take and the options provided.

Parameters:
- `option-spec`: clojure.tools.cli vector defining opts.
- `usage-fn: usage function employed to print a desctiption of the command.`
- `args->opts`: Function taking the result of clojure.tools.cli/parse-opts
(parsed program arguments) and returning either a map containing the customarily verified
arguments to be used by the program.
sourceraw docstring

parse-potential-keywordclj

(parse-potential-keyword arg)

return the correct level in the accepted ones (major, minor, patch) or nil otherwise

return the correct level in the accepted ones (major, minor, patch) or nil otherwise
sourceraw docstring

process-parsed-optsclj

(process-parsed-opts parsed)
source

read-config-fileclj

(read-config-file path)
source

wrap-exitclj

(wrap-exit f)

Wraps a function intended to be the main function of a program. The result of the wripping is a main function that will executed the wrapped one then forward its result to the exit function.

Wraps a function intended to be the main function of a program.
The result of the wripping is a main function that will executed the wrapped one then
forward its result to the exit function.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close