comparison cmdline/org/tmatesoft/hg/console/Bundle.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 9b99d27aeddc
children 5f9073eabf06
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 21
21 import org.tmatesoft.hg.core.Nodeid; 22 import org.tmatesoft.hg.core.Nodeid;
22 import org.tmatesoft.hg.repo.HgBundle; 23 import org.tmatesoft.hg.repo.HgBundle;
23 import org.tmatesoft.hg.repo.HgChangelog; 24 import org.tmatesoft.hg.repo.HgChangelog;
24 import org.tmatesoft.hg.repo.HgLookup; 25 import org.tmatesoft.hg.repo.HgLookup;
32 * @author Artem Tikhomirov 33 * @author Artem Tikhomirov
33 * @author TMate Software Ltd. 34 * @author TMate Software Ltd.
34 */ 35 */
35 public class Bundle { 36 public class Bundle {
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 final HgRepository hgRepo = cmdLineOpts.findRepository(); 39 final 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 }