comparison cmdline/org/tmatesoft/hg/console/Tags.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 b2cfbe46f9b6
children 2fadf8695f8a
comparison
equal deleted inserted replaced
298:aac0c3fab6ce 299:45dc79e545f5
14 * the terms of a license other than GNU General Public License 14 * the terms of a license other than GNU General Public License
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.util.Collections;
19 import java.util.Comparator; 20 import java.util.Comparator;
20 import java.util.HashMap; 21 import java.util.HashMap;
21 import java.util.Map; 22 import java.util.Map;
22 import java.util.TreeSet; 23 import java.util.TreeSet;
23 24
32 * @author TMate Software Ltd. 33 * @author TMate Software Ltd.
33 */ 34 */
34 public class Tags { 35 public class Tags {
35 36
36 public static void main(String[] args) throws Exception { 37 public static void main(String[] args) throws Exception {
37 Options cmdLineOpts = Options.parse(args); 38 Options cmdLineOpts = Options.parse(args, Collections.<String>emptySet());
38 HgRepository hgRepo = cmdLineOpts.findRepository(); 39 HgRepository hgRepo = cmdLineOpts.findRepository();
39 if (hgRepo.isInvalid()) { 40 if (hgRepo.isInvalid()) {
40 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); 41 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation());
41 return; 42 return;
42 } 43 }