Liking cljdoc? Tell your friends :D

hive-addon.cli.tree

Command-path parsing and handler-tree resolution.

A handler tree maps keyword segments either to a handler fn or to a nested tree. A nested tree may carry :_handler as the value used when a path stops there, or when no deeper segment matches.

Command-path parsing and handler-tree resolution.

A handler tree maps keyword segments either to a handler fn or to a
nested tree. A nested tree may carry :_handler as the value used when a
path stops there, or when no deeper segment matches.
raw docstring

collect-command-pathsclj/s

(collect-command-paths handlers prefix)

Every callable path in HANDLERS as a seq of keyword vectors, PREFIX prepended. A subtree carrying :_handler also contributes its own path.

Every callable path in HANDLERS as a seq of keyword vectors, PREFIX
prepended. A subtree carrying :_handler also contributes its own path.
sourceraw docstring

format-helpclj/s

(format-help handlers)

Help text listing every command path in HANDLERS, one per line.

Help text listing every command path in HANDLERS, one per line.
sourceraw docstring

normalize-commandclj/s

(normalize-command command)

COMMAND as a string. Accepts a keyword or a string; anything else is nil.

COMMAND as a string. Accepts a keyword or a string; anything else is nil.
sourceraw docstring

parse-commandclj/s

(parse-command command)

COMMAND parsed into a keyword path: "status list" -> [:status :list]. Nil for a nil or blank command.

COMMAND parsed into a keyword path: "status list" -> [:status :list].
Nil for a nil or blank command.
sourceraw docstring

resolve-handlerclj/s

(resolve-handler handlers path)

Walk HANDLERS along PATH.

Returns {:handler fn :path-used [...] :remaining [...]} on a hit, {:tree subtree :path-used [...]} when the path stops at a subtree with no :_handler, or {:error :not-found :path-used [...] :remaining [...]} when a segment does not match and no :_handler is available.

Walk HANDLERS along PATH.

Returns {:handler fn :path-used [...] :remaining [...]} on a hit,
{:tree subtree :path-used [...]} when the path stops at a subtree with no
:_handler, or {:error :not-found :path-used [...] :remaining [...]} when a
segment does not match and no :_handler is available.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close