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

public abstract class ACommand extends Object implements Runnable
Base class for Convex CLI command components and mixins
  • Constructor Details

    • ACommand

      public ACommand()
  • Method Details

    • cli

      public abstract Main 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()
      Specified by:
      run in interface Runnable
    • execute

      protected abstract void execute() throws InterruptedException
      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

      public void paranoia(String message)
    • inform

      protected void inform(int level, String formattedMessage)
    • verbose

      protected int verbose()
      Gets the current verbosity level for the CLI
      Returns:
    • println

      public void println(String s)
    • printResult

      public void printResult(Result result)
    • printRecord

      public void printRecord(RecordOutput output)
    • println

      public void println(Object value)
    • isInteractive

      public boolean isInteractive()
      Checks if the CLI is in interactive mode (user input permitted)
      Returns:
      True if in interactive mode
    • prompt

      public String prompt(String message)
      Prompt the user for String input
      Parameters:
      message - Message to prompt user with
      Returns:
      String input from user
    • readPassword

      public char[] readPassword(String prompt)
    • isColoured

      protected boolean isColoured()
      Checks if the CLI should output ANSI colours
      Returns:
    • informSuccess

      public void informSuccess(String message)
    • informError

      public void informError(String message)
    • inform

      public void inform(String message)
    • informWarning

      public void informWarning(String message)