Package convex.cli
Class ACommand
java.lang.Object
convex.cli.ACommand
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AAccountCommand,AEtchCommand,AKeyCommand,ALocalCommand,AMixin,APeerCommand,ATopCommand,Main
Base class for Convex CLI command components and mixins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Maincli()Gets the current CLI main command instancepicocli.CommandLineprotected abstract voidexecute()Execute this command.protected voidvoidvoidinformError(String message) voidinformSuccess(String message) voidinformWarning(String message) protected booleanChecks if the CLI should output ANSI coloursbooleanChecks if the CLI is in interactive mode (user input permitted)booleanChecks if the CLI is in strict (paranoid) modevoidvoidvoidvoidprintRecord(RecordOutput output) voidprintResult(Result result) Prompt the user for String inputchar[]readPassword(String prompt) final voidrun()voidprotected intverbose()Gets the current verbosity level for the CLI
-
Constructor Details
-
ACommand
public ACommand()
-
-
Method Details
-
cli
Gets the current CLI main command instance- Returns:
- CLI instance
-
showUsage
public void showUsage() -
commandLine
public picocli.CommandLine commandLine() -
run
public final void run() -
execute
Execute this command. Subclasses should override this to provide specific command functionality- Throws:
InterruptedException
-
isParanoid
public boolean isParanoid()Checks if the CLI is in strict (paranoid) mode- Returns:
- true iff in strict mode
-
paranoia
-
inform
-
verbose
protected int verbose()Gets the current verbosity level for the CLI- Returns:
-
println
-
printResult
-
printRecord
-
println
-
isInteractive
public boolean isInteractive()Checks if the CLI is in interactive mode (user input permitted)- Returns:
- True if in interactive mode
-
prompt
Prompt the user for String input- Parameters:
message- Message to prompt user with- Returns:
- String input from user
-
readPassword
-
isColoured
protected boolean isColoured()Checks if the CLI should output ANSI colours- Returns:
-
informSuccess
-
informError
-
inform
-
informWarning
-