Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx> --- .../src/org/spearce/jgit/pgm/LsRemote.java | 23 +++++-------------- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/LsRemote.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/LsRemote.java index 921bcff..391a04d 100644 --- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/LsRemote.java +++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/LsRemote.java @@ -37,30 +37,19 @@ package org.spearce.jgit.pgm; +import org.kohsuke.args4j.Argument; import org.spearce.jgit.lib.AnyObjectId; import org.spearce.jgit.lib.Ref; import org.spearce.jgit.transport.FetchConnection; import org.spearce.jgit.transport.Transport; class LsRemote extends TextBuiltin { - @Override - public void execute(final String[] args) throws Exception { - int argi = 0; - for (; argi < args.length; argi++) { - final String a = args[argi]; - if ("--".equals(a)) { - argi++; - break; - } else - break; - } + @Argument(index = 0, metaVar = "uri-ish", required = true) + private String remote; - if (argi == args.length) - throw die("usage: url"); - else if (argi + 1 < args.length) - throw die("too many arguments"); - - final Transport tn = Transport.open(db, args[argi]); + @Override + protected void run() throws Exception { + final Transport tn = Transport.open(db, remote); final FetchConnection c = tn.openFetch(); try { for (final Ref r : c.getRefs()) { -- 1.5.6.3.569.ga9185 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html