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.
raw 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.
raw 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.
raw 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. 
raw docstring

children-successorclj

(children-successor schema)

Given a schema [:enum :a :b :c :d], return a Clojure map (that is, a queryable data structure) that returns 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 for non-idempotent options (like :verbose), 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 is,
a queryable data structure) that returns 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 for non-idempotent
options (like :verbose), but code is generic so you might think of a
use case on another schema type.
raw 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.
raw docstring

deep-mergeclj

(deep-merge & maps)

It merges maps recursively. It merges the maps from left to right and the right-most value wins. It is useful to merge the user defined configuration on top of the default configuration. example:

(deep-merge {:foo 1 :bar {:baz 2}}
            {:foo 2 :bar {:baz 1 :qux 3}})
;;=> {:foo 2, :bar {:baz 1, :qux 3}}

From https://github.com/BrunoBonacci/1config

It merges maps recursively. It merges the maps from left
to right and the right-most value wins. It is useful to merge the
user defined configuration on top of the default configuration.
example:
``` clojure
(deep-merge {:foo 1 :bar {:baz 2}}
            {:foo 2 :bar {:baz 1 :qux 3}})
;;=> {:foo 2, :bar {:baz 1, :qux 3}}
```
From https://github.com/BrunoBonacci/1config
raw docstring

default-arg-numberclj


default-valueclj

(default-value value-schema)

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.
raw docstring

long-option->value-schemaclj

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

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.
raw docstring

non-idempotent-optionclj


parse-argsclj

(parse-args label+value-schemas args)

Entry point to the technical work of turning a sequence 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:

  • ::operands 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 sequence 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:

- `::operands` 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.
raw docstring

ParsingResultclj


prefix-shadowingclj

(prefix-shadowing value-schemas)

remove-keyclj

(remove-key f m)

short-option->value-schemaclj

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

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.
raw docstring

simple-summaryclj

(simple-summary schema)

simple-summary-headerclj


start-with?clj

(start-with? prefix path)

Return true if the collection path starts with all the items of collection prefix.

Return true if the collection `path` starts with all the items of
collection `prefix`.
raw docstring

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.
raw docstring

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

× close