Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Manifest.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 | 4c3b9f679412 |
children | ee8264d80747 |
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 static org.tmatesoft.hg.console.Options.asSet; | |
19 import static org.tmatesoft.hg.repo.HgRepository.TIP; | 20 import static org.tmatesoft.hg.repo.HgRepository.TIP; |
20 | 21 |
21 import org.tmatesoft.hg.core.HgFileRevision; | 22 import org.tmatesoft.hg.core.HgFileRevision; |
22 import org.tmatesoft.hg.core.HgManifestCommand; | 23 import org.tmatesoft.hg.core.HgManifestCommand; |
23 import org.tmatesoft.hg.core.Nodeid; | 24 import org.tmatesoft.hg.core.Nodeid; |
31 * @author TMate Software Ltd. | 32 * @author TMate Software Ltd. |
32 */ | 33 */ |
33 public class Manifest { | 34 public class Manifest { |
34 | 35 |
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, asSet("--debug", "-v", "--verbose")); |
37 HgRepository hgRepo = cmdLineOpts.findRepository(); | 38 HgRepository hgRepo = cmdLineOpts.findRepository(); |
38 if (hgRepo.isInvalid()) { | 39 if (hgRepo.isInvalid()) { |
39 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); | 40 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); |
40 return; | 41 return; |
41 } | 42 } |