Teach all ssh commands to stop option parsing on --

Using -- as a way to break the option parser and start doing
argument parsing is very common.  Teach all of our commands
to work that way.

Change-Id: Iaeb1be2ee443fce7f09a9eff6dd7270e1ba91509
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-01-02 18:45:16 -08:00
parent 4039675ad5
commit 9ead06f525
2 changed files with 46 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import com.google.gerrit.server.project.NoSuchChangeException;
import com.google.gerrit.server.project.NoSuchProjectException;
import com.google.gerrit.sshd.SshScope.Context;
import com.google.gerrit.util.cli.CmdLineParser;
import com.google.gerrit.util.cli.EndOfOptionsHandler;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -60,6 +61,9 @@ public abstract class BaseCommand implements Command {
@Option(name = "--help", usage = "display this help text", aliases = {"-h"})
private boolean help;
@Option(name = "--", usage = "end of options", handler = EndOfOptionsHandler.class)
private boolean endOfOptions;
protected InputStream in;
protected OutputStream out;
protected OutputStream err;