1 /*
2 * Created on 2003-6-2 17:13:54 by joel guo
3 *
4 * vTradEx Information Technology Inc.
5 */
6 package com.cyclops.albumbuilder;
7 import java.util.Properties;
8
9 import org.apache.commons.cli.CommandLine;
10 import org.apache.commons.cli.Options;
11 import org.apache.commons.cli.ParseException;
12 import org.apache.commons.cli.PosixParser;
13 /***
14 * Add description for this class <font color="red">HERE</font>!
15 * <big><font face="黑体">惩前毖后,治病救人</font></big>
16 *
17 * @author <a href="mailto:joeblack.guo@vtradex.com">joel guo</a>
18 * @company <a href="http://www.vtradex.com">vTradEx</a>
19 * @since 2003-6-2 17:13:54
20 */
21 public class AlbumBuilderCli {
22 private static final String DEFAULT_DESCRIPTOR = "project.properties";
23 private Properties additionalProperties = new Properties();
24 private String[] commands = {
25 };
26 private static final String DESCRIPTOR = "projectDescriptor";
27 private String descriptor = DEFAULT_DESCRIPTOR;
28 public String getDescriptor() {
29 return descriptor;
30 }
31 /*** Method getAdditionalProperties()
32 * @return
33 */
34 public Properties getAdditionalProperties() {
35 return additionalProperties;
36 }
37 /*** Method parse()
38 * @param args Arguments from command line
39 */
40 public void parse(String[] args) throws ParseException {
41 Options options = new Options();
42 options.addOption(
43 "p",
44 DESCRIPTOR,
45 true,
46 "Specify another project.properties file as configuration");
47 options.addOption(
48 "D",
49 true,
50 "Overwriter configuration in project.properties file");
51 PosixParser pp = new PosixParser();
52 CommandLine cli = pp.parse(options, args);
53 if (cli.hasOption(DESCRIPTOR)) {
54 descriptor = cli.getOptionValue(DESCRIPTOR);
55 }
56 commands = cli.getArgs();
57 //cli.getOption
58 }
59 /*** Method getCommands()
60 * @return
61 */
62 public String[] getCommands() {
63 return commands;
64 }
65 }
This page was automatically generated by Maven