Liking cljdoc? Tell your friends :D

jepsen.cli

Command line interface. Provides a default main method for common Jepsen functions (like the web interface), and utility functions for Jepsen tests to create their own test runners.

Command line interface. Provides a default main method for common Jepsen
functions (like the web interface), and utility functions for Jepsen tests to
create their own test runners.
raw docstring

-mainclj

(-main & args)

default-nodesclj


help-optclj


one-ofclj

(one-of coll)

Takes a collection and returns a string like "Must be one of ..." and a list of names. For maps, uses keys.

Takes a collection and returns a string like "Must be one of ..." and a
list of names. For maps, uses keys.
raw docstring

package-optclj

(package-opt default)
(package-opt option-name default)

parse-concurrencyclj

(parse-concurrency parsed)

Takes a parsed map. Parses :concurrency; if it is a string ending with n, e.g 3n, sets it to 3 * the number of :nodes. Otherwise, parses as a plain integer.

Takes a parsed map. Parses :concurrency; if it is a string ending with n,
e.g 3n, sets it to 3 * the number of :nodes. Otherwise, parses as a plain
integer.
raw docstring

parse-nodesclj

(parse-nodes parsed)

Takes a parsed map and merges all the various node specifications together. In particular:

  • If :nodes-file and :nodes are blank, and :node is the default node list, uses the default node list.
  • Otherwise, merges together :nodes-file, :nodes, and :node into a single list.

The new parsed map will have a merged nodes list in :nodes, and lose :nodes-file and :node options.

Takes a parsed map and merges all the various node specifications together.
In particular:

- If :nodes-file and :nodes are blank, and :node is the default node list,
  uses the default node list.
- Otherwise, merges together :nodes-file, :nodes, and :node into a single
  list.

The new parsed map will have a merged nodes list in :nodes, and lose
:nodes-file and :node options.
raw docstring

rename-keysclj

(rename-keys m replacements)

Given a map m, and a map of keys to replacement keys, yields m with keys renamed.

Given a map m, and a map of keys to replacement keys, yields m with keys
renamed.
raw docstring

rename-optionsclj

(rename-options parsed replacements)

Like rename-keys, but takes a parsed map and updates keys in :options.

Like rename-keys, but takes a parsed map and updates keys in :options.
raw docstring

rename-ssh-optionsclj

(rename-ssh-options parsed)

Takes a parsed map and moves SSH options to a map under :ssh.

Takes a parsed map and moves SSH options to a map under :ssh.
raw docstring

repeated-optclj

(repeated-opt short-opt long-opt docstring default)
(repeated-opt short-opt long-opt docstring default parse-map)

Helper for vector options where we want to replace the default vector (checking via identical?) if any options are passed, building a vector for multiple args. If parse-map is provided (a map of string cmdline options to parsed values), the special word "all" can be used to specify every value in the map.

Helper for vector options where we want to replace the default vector
(checking via identical?) if any options are passed, building a vector for
multiple args. If parse-map is provided (a map of string cmdline options to
parsed values), the special word "all" can be used to specify every value
in the map.
raw docstring

run!clj

(run! subcommands [command & arguments])

Parses arguments and runs tests, etc. Takes a map of subcommand names to subcommand-specs, and a list of arguments. Each subcommand-spec is a map with the following keys:

:opt-spec - The option parsing spec to use. :opt-fn - A function to transform the tools.cli options map, e.g. {:options ..., :arguments ..., :summary ...}. Default: identity :usage - A usage string (default: "Usage:") :run - Function to execute with the transformed options (default: pprint)

If an unrecognized (or no command) is given, prints out a general usage guide and exits.

For a subcommand, if help or --help is given, prints out a help string with usage for the given subcommand and exits with status 0.

If invalid arguments are given, prints those errors to the console, and exits with status 254.

Finally, if everything looks good, calls the given subcommand's run function with parsed options, and exits with status 0.

Catches exceptions, logs them to the console, and exits with status 255.

Parses arguments and runs tests, etc. Takes a map of subcommand names to
subcommand-specs, and a list of arguments. Each subcommand-spec is a map with
the following keys:

:opt-spec       - The option parsing spec to use.
:opt-fn         - A function to transform the tools.cli options map, e.g.
                  {:options ..., :arguments ..., :summary ...}. Default:
                  identity
:usage          - A usage string (default: "Usage:")
:run            - Function to execute with the transformed options
                  (default: pprint)

If an unrecognized (or no command) is given, prints out a general usage guide
and exits.

For a subcommand, if help or --help is given, prints out a help string with
usage for the given subcommand and exits with status 0.

If invalid arguments are given, prints those errors to the console, and exits
with status 254.

Finally, if everything looks good, calls the given subcommand's `run`
function with parsed options, and exits with status 0.

Catches exceptions, logs them to the console, and exits with status 255.
raw docstring

serve-cmdclj

(serve-cmd)

A web server command.

A web server command.
raw docstring

single-test-cmdclj

(single-test-cmd opts)

A command which runs a single test with standard built-ins. Options:

{:opt-spec A vector of additional options for tools.cli. Appended to test-opt-spec. Optional. :opt-fn A function which transforms parsed options. Composed after test-opt-fn. Optional. :tarball If present, adds a --tarball option to this command, defaulting to whatever URL is given here. :usage Defaults to jc/test-usage. Optional. :test-fn A function that receives the option map and constructs a test.}

This comes with two commands: test, which runs a test and analyzes it, and analyze, which constructs a test map using the same arguments as run, but analyzes a history from disk instead.

A command which runs a single test with standard built-ins. Options:

{:opt-spec A vector of additional options for tools.cli. Appended to
           `test-opt-spec`. Optional.
 :opt-fn   A function which transforms parsed options. Composed after
           `test-opt-fn`. Optional.
 :tarball If present, adds a --tarball option to this command, defaulting to
          whatever URL is given here.
 :usage   Defaults to `jc/test-usage`. Optional.
 :test-fn A function that receives the option map and constructs a test.}

This comes with two commands: `test`, which runs a test and analyzes it, and
`analyze`, which constructs a test map using the same arguments as `run`, but
analyzes a history from disk instead.
raw docstring

tarball-optclj

(tarball-opt default)

test-opt-fnclj

(test-opt-fn parsed)

An opt fn for running simple tests. Remaps ssh keys, remaps :node to :nodes, reads :nodes-file into :nodes, and parses :concurrency.

An opt fn for running simple tests. Remaps ssh keys, remaps :node to :nodes,
reads :nodes-file into :nodes, and parses :concurrency.
raw docstring

test-opt-specclj

Command line options for testing.

Command line options for testing.
raw docstring

test-usageclj

(test-usage)

validate-tarballclj

(validate-tarball parsed)

Takes a parsed map and ensures a tarball is present.

Takes a parsed map and ensures a tarball is present.
raw docstring

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

× close