Index

A C D E G H I J L N O P R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

A

arg(String, String, String, String...) - Method in class io.github.wankdanker.clyops.Cli
Register a positional argument.
argVariadic(String, String, String...) - Method in class io.github.wankdanker.clyops.Cli
Register a final positional argument that collects all remaining tokens.

C

Cli - Class in io.github.wankdanker.clyops
Declarative, one-line-per-option CLI parsing: validation, help text, a JSON schema of the interface, config files, environment variables and shell completion.
Cli(String) - Constructor for class io.github.wankdanker.clyops.Cli
A Cli for the program name, shown in help and used for completion.
command(String, String) - Method in class io.github.wankdanker.clyops.Cli
Register a command (spec section 1.7) and return it, to register its options and arguments on.
commandPath() - Method in class io.github.wankdanker.clyops.Cli
The command words selected by the last parse, e.g.
completionData() - Method in class io.github.wankdanker.clyops.Cli
Tab-separated completion records (spec section 9) for the program itself.
completionData(List<String>) - Method in class io.github.wankdanker.clyops.Cli
Tab-separated completion records (spec section 9).
completionScript(String) - Method in class io.github.wankdanker.clyops.Cli
Shell script that enables completion for this program (spec section 9): eval "$(prog --completion bash)".

D

describeRule(String) - Static method in class io.github.wankdanker.clyops.Cli
Help text for a validation rule (spec section 5).
detail() - Method in record class io.github.wankdanker.clyops.ParseResult
Returns the value of the detail record component.
die(int, String, Object...) - Static method in class io.github.wankdanker.clyops.Log
Log an error (never suppressed) and exit with code.

E

equals(Object) - Method in record class io.github.wankdanker.clyops.ParseResult
Indicates whether some other object is "equal to" this one.
error() - Method in record class io.github.wankdanker.clyops.ParseResult
Returns the value of the error record component.
error(String, Object...) - Static method in class io.github.wankdanker.clyops.Log
Log an error to stderr using String.format arguments.
exclusive(String...) - Method in class io.github.wankdanker.clyops.Cli
At most one of these options may be given.

G

get(String) - Method in class io.github.wankdanker.clyops.Cli
Look up a resolved value by option variable or positional name; null when absent.
getBool(String) - Method in class io.github.wankdanker.clyops.Values
The value as a boolean (false when unset).
getDouble(String) - Method in class io.github.wankdanker.clyops.Values
The value as a double (0 when unset).
getInt(String) - Method in class io.github.wankdanker.clyops.Values
The value as an int (0 when unset).
getList(String) - Method in class io.github.wankdanker.clyops.Values
An array option's or variadic argument's values.
getLong(String) - Method in class io.github.wankdanker.clyops.Values
The value as a long (0 when unset).
getString(String) - Method in class io.github.wankdanker.clyops.Values
The value as a string ("" when unset).
getStrings(String) - Method in class io.github.wankdanker.clyops.Values
An array option's or variadic argument's values as strings.

H

hashCode() - Method in record class io.github.wankdanker.clyops.ParseResult
Returns a hash code value for this object.

I

info(String, Object...) - Static method in class io.github.wankdanker.clyops.Log
Log an informational message to stderr using String.format arguments.
io.github.wankdanker.clyops - package io.github.wankdanker.clyops
 
isExplicitlySet(String) - Method in class io.github.wankdanker.clyops.Cli
Whether the option came from CLI, config, or environment rather than a default.
isSet(String) - Method in class io.github.wankdanker.clyops.Cli
Whether the option came from the command line.

J

jsonSchema() - Method in class io.github.wankdanker.clyops.Cli
JSON description of the CLI (spec section 8).

L

Log - Class in io.github.wankdanker.clyops
Logging to stderr with timestamps and colors (spec section 11): import static ...Log.*.

N

name() - Method in class io.github.wankdanker.clyops.Cli
The program name shown in help and completion.

O

oneOf(String...) - Method in class io.github.wankdanker.clyops.Cli
At least one of these options must be given.
opt(String, String, String, String, String, String...) - Method in class io.github.wankdanker.clyops.Cli
Register an option.
optArray(String, String, String, String, String...) - Method in class io.github.wankdanker.clyops.Cli
Register a repeatable option whose values accumulate into a list.

P

parse(String...) - Method in class io.github.wankdanker.clyops.Cli
Parse without exiting.
ParseResult - Record Class in io.github.wankdanker.clyops
The outcome of parse(java.lang.String...): status is "ok", "help" or "error".
ParseResult(String, String, boolean, List<String>) - Constructor for record class io.github.wankdanker.clyops.ParseResult
Creates an instance of a ParseResult record class.

R

requireCommand(String, String, String) - Method in class io.github.wankdanker.clyops.Cli
Declare an external command the program needs.
requires(String, String...) - Method in class io.github.wankdanker.clyops.Cli
When lng is given, the others must be too.
resolvePath(String, String, List<String>) - Static method in class io.github.wankdanker.clyops.Cli
Resolve a path value against base (spec section 6), trying searchDirs for bare names.
run(String...) - Method in class io.github.wankdanker.clyops.Cli
Parse like a CLI: handles --help, --help-json-schema, --completion and --bash-completion, prints errors and exits on failure.

S

setConfig(String, String) - Method in class io.github.wankdanker.clyops.Cli
option holds the config file path; prefixes is comma-separated.
setCwd(String) - Method in class io.github.wankdanker.clyops.Cli
Base for command-line path values (default: the working directory).
setDescription(String) - Method in class io.github.wankdanker.clyops.Cli
Set the help description and return this CLI.
setEffects(String...) - Method in class io.github.wankdanker.clyops.Cli
What running the program does: read-only, idempotent, destructive, network.
setEnv(Map<String, String>) - Method in class io.github.wankdanker.clyops.Cli
The environment to read (default: the process environment).
setEpilog(String) - Method in class io.github.wankdanker.clyops.Cli
Set the final help text and return this CLI.
setPathSearch(String, String) - Method in class io.github.wankdanker.clyops.Cli
Fallback directories (colon-separated, relative to the root) for bare relative values of a path option.
setRoot(String) - Method in class io.github.wankdanker.clyops.Cli
Base for default path values (default: the working directory); relative to the working directory.
setSilent(boolean) - Static method in class io.github.wankdanker.clyops.Log
Suppress info/warn/error/success output (die and parse errors still print).
setStdin(String, String) - Method in class io.github.wankdanker.clyops.Cli
What the program reads on stdin; contentType is a MIME type or a comma-separated list.
setStdout(String, String) - Method in class io.github.wankdanker.clyops.Cli
What the program writes on stdout; undeclared means text.
showUsage() - Method in record class io.github.wankdanker.clyops.ParseResult
Returns the value of the showUsage record component.
source(String) - Method in class io.github.wankdanker.clyops.Cli
Where an option's value came from: cli, config, env, default or unset.
status() - Method in record class io.github.wankdanker.clyops.ParseResult
Returns the value of the status record component.
success(String, Object...) - Static method in class io.github.wankdanker.clyops.Log
Log a success message to stderr using String.format arguments.

T

toString() - Method in record class io.github.wankdanker.clyops.ParseResult
Returns a string representation of this record class.

U

usage() - Method in class io.github.wankdanker.clyops.Cli
Help text (spec section 7), for the selected command.

V

validate(String, String, String) - Static method in class io.github.wankdanker.clyops.Cli
Validate value against rule and return its typed form: Long for int* and port (BigInteger beyond a long), Double for float*, Boolean for bool, the String otherwise.
ValidationError - Exception Class in io.github.wankdanker.clyops
A value that fails its validation rule; the message is the spec's error text.
ValidationError(String) - Constructor for exception class io.github.wankdanker.clyops.ValidationError
Construct a validation error with the rule failure message.
values() - Method in class io.github.wankdanker.clyops.Cli
The resolved values from the last parse.
Values - Class in io.github.wankdanker.clyops
Resolved values keyed by option variable and argument name, in registration order.
Values() - Constructor for class io.github.wankdanker.clyops.Values
 
valuesJson() - Method in class io.github.wankdanker.clyops.Cli
Resolved values as JSON (spec section 10), in registration order.
VERSION - Static variable in class io.github.wankdanker.clyops.Cli
The clyops version this library implements.

W

warn(String, Object...) - Static method in class io.github.wankdanker.clyops.Log
Log a warning to stderr using String.format arguments.
wrapText(String, int) - Static method in class io.github.wankdanker.clyops.Cli
Greedy word wrap that keeps existing line breaks (spec section 7).
A C D E G H I J L N O P R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form