Mercurial > hg4j
comparison src/com/tmate/hgkit/fs/RepositoryLookup.java @ 48:e34f90b9ded1
Limit option for history/log
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Fri, 14 Jan 2011 23:22:20 +0100 |
| parents | aa1912c70b36 |
| children | 26e3eeaa3962 |
comparison
equal
deleted
inserted
replaced
| 47:b01500fe2604 | 48:e34f90b9ded1 |
|---|---|
| 54 | 54 |
| 55 public static class Options { | 55 public static class Options { |
| 56 | 56 |
| 57 public String repoLocation; | 57 public String repoLocation; |
| 58 public List<String> files; | 58 public List<String> files; |
| 59 public int limit = -1; | |
| 59 | 60 |
| 60 public static Options parse(String[] commandLineArgs) { | 61 public static Options parse(String[] commandLineArgs) { |
| 61 Options rv = new Options(); | 62 Options rv = new Options(); |
| 62 List<String> args = Arrays.asList(commandLineArgs); | 63 List<String> args = Arrays.asList(commandLineArgs); |
| 63 LinkedList<String> files = new LinkedList<String>(); | 64 LinkedList<String> files = new LinkedList<String>(); |
| 74 throw new IllegalArgumentException("Need repo location"); | 75 throw new IllegalArgumentException("Need repo location"); |
| 75 } | 76 } |
| 76 rv.repoLocation = it.next(); | 77 rv.repoLocation = it.next(); |
| 77 break; | 78 break; |
| 78 } | 79 } |
| 80 case (int) 'l' : { | |
| 81 if (!it.hasNext()) { | |
| 82 throw new IllegalArgumentException(); | |
| 83 } | |
| 84 rv.limit = Integer.parseInt(it.next()); | |
| 85 break; | |
| 86 } | |
| 79 } | 87 } |
| 80 } else { | 88 } else { |
| 81 // filename | 89 // filename |
| 82 files.add(arg); | 90 files.add(arg); |
| 83 } | 91 } |
