Liking cljdoc? Tell your friends :D

piotr-yuxuan.malli-cli


-make-formatclj

(-make-format lens)

Given a sequence of column widths, return a string suitable for use in format to print a sequences of strings in those columns.

Given a sequence of column widths, return a string suitable for use in
format to print a sequences of strings in those columns.
sourceraw docstring

-parse-optionclj

(-parse-option {:keys [in update-fn arg-number schema] :as value-schema}
               options
               arg
               argstail)

Take the current arglist head arg, the tail args-tail. Depending on the value schema consume some items from the tail and when applicable pass them on toupdate-fn`. This is actually the core of the work that transforms a vector of string to a map of options.

Take the current arglist head `arg`, the tail args-tail`. Depending
on the value schema consume some items from the tail and when
applicable pass them on to `update-fn`. This is actually the core of
the work that transforms a vector of string to a map of options.
sourceraw docstring

break-long-option-and-valueclj

(break-long-option-and-value arg argstail)

Expand an argument that contains both an option label and a value into two arguments: the label, and the value.

Expand an argument that contains both an option label and a value
into two arguments: the label, and the value.
sourceraw docstring

break-short-option-groupclj

(break-short-option-group label+value-schemas arg argstail)

Expand a group of short option labels into a several short labels and interpolate them with the tail of the arglist args-tail` depending on the number of arguments each option needs.

Expand a group of short option labels into a several short labels and
interpolate them with the tail of the arglist args-tail` depending
on the number of arguments each option needs. 
sourceraw docstring

children-successorclj

(children-successor schema)

Given a schema [:enum :a :b :c :d], return a Clojure map that return the next item of :a -> :b -> :c -> :d <-> :d. The last item is mapped onto itself. If the schema has a default value as a property, like in [:enum {:default :b} :a :b :c :d] an additional mapping will be made nil -> :c.

Primarily intended to be used on enum schema, but code is generic so you might think of a use case on another schema type.

Given a schema `[:enum :a :b :c :d]`, return a Clojure map that
return the next item of :a -> :b -> :c -> :d <-> :d. The last item
is mapped onto itself. If the schema has a default value as a
property, like in `[:enum {:default :b} :a :b :c :d]` an additional
mapping will be made nil -> :c.

Primarily intended to be used on enum schema, but code is generic so
you might think of a use case on another schema type.
sourceraw docstring

cli-args-transformerclj

The malli transformer wrapping parse-args. To be used it with m/decode, wrapped by mt/transformer. Merely turn a sequence of arguments args into a map that (maybe) conforms to a schema. You can compose this transformer to further refine command-line argument parsing. See simple-cli-options-transformer for an example.

The malli transformer wrapping `parse-args`. To be used it with
`m/decode`, wrapped by `mt/transformer`. Merely turn a sequence of
arguments `args` into a map that (maybe) conforms to a `schema`. You
can compose this transformer to further refine command-line argument
parsing. See `simple-cli-options-transformer` for an example.
sourceraw docstring

default-arg-numberclj

source

label+value-schemaclj

(label+value-schema {:keys [in schema] :as value-schema})

Return MapEntry items, when applicable one for short, and long option names.

Return `MapEntry` items, when applicable one for short, and long
option names.
sourceraw docstring

long-option->value-schemaclj

(long-option->value-schema default-label value-schema)
source

name-itemsclj

(name-items x)

Take an argument and return a vector of items that will form an option name. For example the option name for :a/b will be a-b.

Take an argument and return a vector of items that will form an
option name. For example the option name for `:a/b` will be a-b.
sourceraw docstring

parse-argsclj

(parse-args schema args)

Entry point to the technical work of turning a sequece of arguments args into a map that (maybe) conforms to a schema. It returns a map of the options as parsed according to the schema, but with two additional keys:

  • ::arguments is a vector of application arguments, that is to say command-line arguments that do not represent an option value.

  • ::cli-args is the raw, untouched vector of command-line arguments received as input. Perhaps you need it for some additional validation of positional logic.

Entry point to the technical work of turning a sequece of arguments
`args` into a map that (maybe) conforms to a `schema`. It returns a
map of the options as parsed according to the schema, but with two
additional keys:

- `::arguments` is a vector of application arguments, that is to say
  command-line arguments that do not represent an option value.

- `::cli-args` is the raw, untouched vector of command-line
  arguments received as input. Perhaps you need it for some
  additional validation of positional logic.
sourceraw docstring

ParsingResultclj

source

prefix-shadowingclj

(prefix-shadowing value-schemas)
source

remove-keyclj

(remove-key f m)
source

short-option->value-schemaclj

(short-option->value-schema default-label value-schema)
source

simple-cli-options-transformerclj

Simple transformer for the most common use cases when you only want to get a (nested) map of options out of command-line arguments. The mt/default-value-transformer will fill the blank and mt/strip-extra-keys-transformer will remove any extraneous keys. Use it for dumb, do-what-I-mean cli args parsing.

Simple transformer for the most common use cases when you only want
to get a (nested) map of options out of command-line arguments. The
`mt/default-value-transformer` will fill the blank and
`mt/strip-extra-keys-transformer` will remove any extraneous
keys. Use it for dumb, do-what-I-mean cli args parsing.
sourceraw docstring

simple-summaryclj

(simple-summary schema)
source

start-with?clj

(start-with? prefix path)
source

value-schemasclj

(value-schemas schema)

Returns all leaf sub schemas for unique paths as a vector of maps with :schema, :path and :in keys.

Returns all leaf sub schemas for unique paths as a vector of maps
with :schema, :path and :in keys.
sourceraw docstring

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

× close