Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Clone.java @ 299:45dc79e545f5
Recognize flag options (options with no arguments) in command line sample apps
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Sat, 17 Sep 2011 13:26:52 +0200 |
| parents | 44a34baabea0 |
| children |
comparison
equal
deleted
inserted
replaced
| 298:aac0c3fab6ce | 299:45dc79e545f5 |
|---|---|
| 15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
| 16 */ | 16 */ |
| 17 package org.tmatesoft.hg.console; | 17 package org.tmatesoft.hg.console; |
| 18 | 18 |
| 19 import java.io.File; | 19 import java.io.File; |
| 20 import java.util.Collections; | |
| 20 import java.util.List; | 21 import java.util.List; |
| 21 | 22 |
| 22 import org.tmatesoft.hg.core.HgCloneCommand; | 23 import org.tmatesoft.hg.core.HgCloneCommand; |
| 23 import org.tmatesoft.hg.repo.HgLookup; | 24 import org.tmatesoft.hg.repo.HgLookup; |
| 24 import org.tmatesoft.hg.repo.HgRemoteRepository; | 25 import org.tmatesoft.hg.repo.HgRemoteRepository; |
| 31 */ | 32 */ |
| 32 public class Clone { | 33 public class Clone { |
| 33 | 34 |
| 34 // ran with args: svnkit c:\temp\hg\test-clone | 35 // ran with args: svnkit c:\temp\hg\test-clone |
| 35 public static void main(String[] args) throws Exception { | 36 public static void main(String[] args) throws Exception { |
| 36 Options cmdLineOpts = Options.parse(args); | 37 Options cmdLineOpts = Options.parse(args, Collections.<String>emptySet()); |
| 37 List<String> noOptsArgs = cmdLineOpts.getList(""); | 38 List<String> noOptsArgs = cmdLineOpts.getList(""); |
| 38 if (noOptsArgs.isEmpty()) { | 39 if (noOptsArgs.isEmpty()) { |
| 39 System.err.println("Need at least one argument pointing to remote server to pull changes from"); | 40 System.err.println("Need at least one argument pointing to remote server to pull changes from"); |
| 40 return; | 41 return; |
| 41 } | 42 } |
