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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user