Class LaunchHelpDispatcher

java.lang.Object
za.co.wethinkcode.robots.cli.help.LaunchHelpDispatcher

public class LaunchHelpDispatcher extends Object
Detects and handles the top-level help CLI command.

Usage from the built jars:

  • help — shows launch help for both server and client
  • help server — shows launch help for the server only
  • help client — shows launch help for the client only
This is intentionally separate from picocli's -h/--help, which documents flags for a single already-selected program. This command documents how to launch either program in the first place, and is consulted before CliParser ever sees the arguments.

  • Constructor Details

    • LaunchHelpDispatcher

      public LaunchHelpDispatcher()
    • LaunchHelpDispatcher

      public LaunchHelpDispatcher(LaunchHelpProvider... providers)
  • Method Details

    • isHelpInvocation

      public static boolean isHelpInvocation(String[] args)
      Parameters:
      args - the raw args passed to a main method
      Returns:
      true if the first argument is the help command
    • render

      public String render(String[] args)
      Builds the help text for the given invocation.
      Parameters:
      args - the raw args passed to a main method; args[0] is expected to be "help", with an optional args[1] of "server"/"client"
      Returns:
      the formatted help text, ready to print