Resolvers of CLI option arguments.
If an argument doesn't appear to be resolvable according to the nature of a given resolver fn, it returns nil. Otherwise, these fns proceed with resolution and will signal any errors encountered as :vivid.art.cli/error conditions, :normally nil for production but managed by the condition system for use in automated testing.
As an example, a file resolver function interprets its argument as a file path. If the file doesn't exist, the resolver fn sensibly returns nil, but if the file does exist, then any errors associated with attempting to read the file's contents is signalled.
Resolvers of CLI option arguments. If an argument doesn't appear to be resolvable according to the nature of a given resolver fn, it returns nil. Otherwise, these fns proceed with resolution and will signal any errors encountered as :vivid.art.cli/error conditions, :normally nil for production but managed by the condition system for use in automated testing. As an example, a file resolver function interprets its argument as a file path. If the file doesn't exist, the resolver fn sensibly returns nil, but if the file does exist, then any errors associated with attempting to read the file's contents is signalled.
(resolve-as-edn-file x & options)
Attempt to interpret a value as a path to an EDN file. If successful, returns either the file content as a data structure, or when option wrap-in-map is true, a map containing a single entry: [the filename sans .edn extension as a symbol, the EDN file's contents].
Attempt to interpret a value as a path to an EDN file. If successful, returns either the file content as a data structure, or when option wrap-in-map is true, a map containing a single entry: [the filename sans .edn extension as a symbol, the EDN file's contents].
(resolve-as-edn-literal x)
Attempt to interpret a value as an EDN string.
Attempt to interpret a value as an EDN string.
(resolve-as-file path)
Attempt to interpret a value as a java.io.File.
Attempt to interpret a value as a java.io.File.
(resolve-as-json-file x & options)
Attempt to interpret a value as a string path to a JSON file. If successful, returns either the file content as a data structure, or when option wrap-in-map is true, a map containing a single entry: [the filename sans .json extension as a symbol, the JSON file's contents].
Attempt to interpret a value as a string path to a JSON file. If successful, returns either the file content as a data structure, or when option wrap-in-map is true, a map containing a single entry: [the filename sans .json extension as a symbol, the JSON file's contents].
(resolve-as-list-like x)
Attempt to interpret a value as a Clojure list or vector.
Attempt to interpret a value as a Clojure list or vector.
(resolve-as-map x)
Attempt to interpret a value as a Clojure map.
Attempt to interpret a value as a Clojure map.
(resolve-as-var x & [default-ns])
Attempt to interpret a value as the name of a namespace-(un)qualified var, defaulting to default-ns if specified. The value would then be a string, a symbol, or a var.
Attempt to interpret a value as the name of a namespace-(un)qualified var, defaulting to default-ns if specified. The value would then be a string, a symbol, or a var.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close