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
,Help
,Main
Base class for Convex CLI command components and mixins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Main
cli()
Gets the current CLI main command instancepicocli.CommandLine
protected abstract void
execute()
Execute this command.protected void
void
void
informError
(String message) void
informSuccess
(String message) void
informWarning
(String message) protected boolean
Checks if the CLI should output ANSI coloursboolean
Checks if the CLI is in interactive mode (user input permitted)boolean
Checks if the CLI is in strict (paranoid) modevoid
void
void
void
printRecord
(RecordOutput output) void
printResult
(Result result) Prompt the user for String inputchar[]
readPassword
(String prompt) final void
run()
void
protected void
showUsage
(picocli.CommandLine cl) protected int
verbose()
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() -
showUsage
protected void showUsage(picocli.CommandLine cl) -
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
-