Display command description in ssh gerrit --help
Show one line description for each ssh command. Make COMMAND
argument optional, so that --help argument is not needed.
This approach is working for core gerrit commands, aliases, nested
commands and plugin's own ssh commands.
To provide a description ssh command must be annotated with
CommandMetaData annotation, i. e.:
@CommandMetaData(name="print", descr="Print greeting in different languages")
public final class PrintHelloWorldCommand extends SshCommand { ...
Syntactic sugar for command registration is provided to reflect the fact,
that both name and description are included in CommandMetaData annotation.
To register command and alias in plugin:
protected void configureCommands() {
command(PrintHelloWorldCommand.class);
alias("say-hello", PrintHelloWorldCommand.class);
[...]
With the outcome:
$ ssh gerrit helloworld
Available commands of helloworld are:
print Print greeting in different languages
say-hello Print greeting in different languages
Change-Id: I2e5440378023ecc5425092d8131f121da2f20a30
39 files changed