Class EdtHelpCmd

java.lang.Object
com.e1c.g5.v8.dt.internal.cli.api.EdtHelpCmd
All Implemented Interfaces:
ICliCommand

public class EdtHelpCmd extends Object implements ICliCommand
Provides help for other 1C:EDT CLI commands (and itself).

The help text for commands and their parameters is taken from the respective CliCommand annotations. The annotation value may contain either plain text or the field name of the Messages class from the command's package. This way NLS can be used to localize command help.

  • Field Details

    • COMMAND_NAME_COMPARATOR

      public static final Comparator<String> COMMAND_NAME_COMPARATOR
      Comparator for command names with namespaces, which ensures that the default namespace goes first.
    • NAMESPACE_SEPARATOR

      public static final String NAMESPACE_SEPARATOR
      Visual separator between command namespace and name.
      See Also:
  • Constructor Details

    • EdtHelpCmd

      public EdtHelpCmd()
  • Method Details

    • stripDefaultNamespace

      public static String stripDefaultNamespace(String name)
      Removes the default namespace from the given name (if it exists).
      Parameters:
      name - name, cannot be null.
      Returns:
      name without the default namespace. Other namespaces will be preserved. Never null.
    • getNameWithNamespace

      public static String getNameWithNamespace(EdtScript script)
      Returns script name with namespace.
      Parameters:
      script - script, cannot be null.
      Returns:
      script name with namespace. Never null.
    • findScriptsByNameWithNamespace

      public static List<EdtScript> findScriptsByNameWithNamespace(com.e1c.g5.v8.dt.internal.cli.api.CommandRegistry registry, String name)
      Returns script by the given name (with possible namespace).
      Parameters:
      registry - command registry, cannot be null.
      name - script name with possible namespace, cannot be null.
      Returns:
      scripts with that name (and namespace, if given), never null.
    • printCallVariants

      public void printCallVariants(PrintStream out, String name)
      Prints short human-friendly help on call variants of the given command.
      Parameters:
      out - print stream to print to, can not be null.
      name - command name, can not be null. If the command is not found, prints nothing.
    • help

      public void help()
    • help

      public void help(String name)