Convert force-draft ssh module into a SingleCommandPluginModule
Since this plugin is only providing one command, convert the ssh module
so the plugin name and the command name are the same ssh argument.
Change-Id: Ifa3e27a12fbf988e615ea694e989eca8f8471944
diff --git a/src/main/java/com/googlesource/gerrit/plugins/forcedraft/ForceDraftSshModule.java b/src/main/java/com/googlesource/gerrit/plugins/forcedraft/ForceDraftSshModule.java
index 1870336..5936b6a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/forcedraft/ForceDraftSshModule.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/forcedraft/ForceDraftSshModule.java
@@ -13,12 +13,15 @@
// limitations under the License.
package com.googlesource.gerrit.plugins.forcedraft;
-import com.google.gerrit.sshd.PluginCommandModule;
+import com.google.gerrit.sshd.SingleCommandPluginModule;
+import com.google.inject.binder.LinkedBindingBuilder;
-public class ForceDraftSshModule extends PluginCommandModule {
+import org.apache.sshd.server.Command;
+
+public class ForceDraftSshModule extends SingleCommandPluginModule {
@Override
- protected void configureCommands() {
- command(ForceDraft.class);
+ protected void configure(LinkedBindingBuilder<Command> bind) {
+ bind.to(ForceDraft.class);
}
}
diff --git a/src/main/resources/Documentation/cmd-force-draft.md b/src/main/resources/Documentation/cmd-force-draft.md
index 2bc4f49..97e77c8 100644
--- a/src/main/resources/Documentation/cmd-force-draft.md
+++ b/src/main/resources/Documentation/cmd-force-draft.md
@@ -1,14 +1,14 @@
-@PLUGIN@ force-draft
+@PLUGIN@
==============
NAME
----
-force-draft force-draft - Force patchset to draft.
+@PLUGIN@ - Force patchset to draft.
SYNOPSIS
--------
```
-ssh -p @SSH_PORT@ @SSH_HOST@ force-draft force-draft <Change, Patchset>
+ssh -p @SSH_PORT@ @SSH_HOST@ @PLUGIN@ <Change, Patchset>
```
DESCRIPTION
@@ -29,5 +29,5 @@
--------
Change status of patchset 3 of change 1234 to 'draft':
```
-ssh -p @SSH_PORT@ @SSH_HOST@ force-draft force-draft 1234,3
+ssh -p @SSH_PORT@ @SSH_HOST@ @PLUGIN@ 1234,3
```