Class EdtHelpCmd
java.lang.Object
com.e1c.g5.v8.dt.internal.cli.api.EdtHelpCmd
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<String>
Comparator for command names with namespaces, which ensures that the default namespace goes first.static final String
Visual separator between command namespace and name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindScriptsByNameWithNamespace
(com.e1c.g5.v8.dt.internal.cli.api.CommandRegistry registry, String name) Returns script by the given name (with possible namespace).static String
getNameWithNamespace
(EdtScript script) Returns script name with namespace.void
help()
void
void
printCallVariants
(PrintStream out, String name) Prints short human-friendly help on call variants of the given command.static String
stripDefaultNamespace
(String name) Removes the default namespace from the given name (if it exists).
-
Field Details
-
COMMAND_NAME_COMPARATOR
Comparator for command names with namespaces, which ensures that the default namespace goes first. -
NAMESPACE_SEPARATOR
Visual separator between command namespace and name.- See Also:
-
-
Constructor Details
-
EdtHelpCmd
public EdtHelpCmd()
-
-
Method Details
-
stripDefaultNamespace
Removes the default namespace from the given name (if it exists).- Parameters:
name
- name, cannot benull
.- Returns:
- name without the default namespace. Other namespaces will be preserved. Never
null
.
-
getNameWithNamespace
Returns script name with namespace.- Parameters:
script
- script, cannot benull
.- 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 benull
.name
- script name with possible namespace, cannot benull
.- Returns:
- scripts with that name (and namespace, if given), never
null
.
-
printCallVariants
Prints short human-friendly help on call variants of the given command.- Parameters:
out
- print stream to print to, can not benull
.name
- command name, can not benull
. If the command is not found, prints nothing.
-
help
public void help() -
help
-