comparison cmdline/org/tmatesoft/hg/console/Main.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 981f9f50bb6c
children ae8d116f4ee2
comparison
equal deleted inserted replaced
298:aac0c3fab6ce 299:45dc79e545f5
72 72
73 private Options cmdLineOpts; 73 private Options cmdLineOpts;
74 private HgRepository hgRepo; 74 private HgRepository hgRepo;
75 75
76 public Main(String[] args) throws Exception { 76 public Main(String[] args) throws Exception {
77 cmdLineOpts = Options.parse(args); 77 cmdLineOpts = Options.parse(args, Collections.<String>emptySet());
78 hgRepo = cmdLineOpts.findRepository(); 78 hgRepo = cmdLineOpts.findRepository();
79 if (hgRepo.isInvalid()) { 79 if (hgRepo.isInvalid()) {
80 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); 80 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation());
81 return; 81 return;
82 } 82 }