Index: maven-commandline-plugin/src/java/org/codelutin/option/def/DefaultOptionAction.java diff -u /dev/null maven-commandline-plugin/src/java/org/codelutin/option/def/DefaultOptionAction.java:1.1 --- /dev/null Sun Mar 23 00:28:46 2008 +++ maven-commandline-plugin/src/java/org/codelutin/option/def/DefaultOptionAction.java Sun Mar 23 00:28:41 2008 @@ -0,0 +1,73 @@ +/** + * ##% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. ##%* + */ +package org.codelutin.option.def; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * les options gérées par commandline (config, help, usage...). + *

+ * Ces options seront générés par le plugin commandline car sont génériques. + * + * @author chemit + */ +public enum DefaultOptionAction { + + showConfig("--show-config * [normal|complete|tec]"), + + editConfig("--edit-config"), + + changeFileConfig("--config-file "), + + changeConfig("--config * [@categories@] "), + + help("--help|-h"), + + helpConfig("--help-config * "), + + resetConfig("--reset-config"), + + ui("--ui "); + + private final String def; + + public static boolean skipDefault = false; + + private DefaultOptionAction(String def) { + this.def = def; + } + + public String def() { + return def; + } + + public String configKey() { + return name() + DefinitionParserUtil.ODEFINITION_KEY_SUFFIX; + } + + public static List getConfigKeys() { + List defaultOptions = new ArrayList(); + if (!skipDefault) { + for (DefaultOptionAction option : DefaultOptionAction.values()) { + defaultOptions.add(option.configKey()); + } + Collections.sort(defaultOptions); + } + return defaultOptions; + } + + +} Index: maven-commandline-plugin/src/java/org/codelutin/option/def/MandatoryConfigProperty.java diff -u /dev/null maven-commandline-plugin/src/java/org/codelutin/option/def/MandatoryConfigProperty.java:1.1 --- /dev/null Sun Mar 23 00:28:46 2008 +++ maven-commandline-plugin/src/java/org/codelutin/option/def/MandatoryConfigProperty.java Sun Mar 23 00:28:41 2008 @@ -0,0 +1,72 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.option.def; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * les propriétés de configuration obligatoires. + * + * @author chemit + */ +public enum MandatoryConfigProperty { + + /** le nom du fichier de configuration de l'application */ + configFileName("java.io.File"), + + /** l'encoding a utiliser sur le systeme */ + encoding("java.lang.String"), + + /** la locale par default à utiliser */ + locale("java.util.Locale"), + + /** le nom du projet */ + projectName("java.lang.String"), + + /** la version du projet */ + version("org.codelutin.util.VersionNumber"); + + private final String type; + + private MandatoryConfigProperty(String type) { + this.type = type; + } + + public String category() { + return "main"; + } + + public String type() { + return type; + } + + public String getEntryKey() { + return category() + '.' + DefinitionParserUtil.CDEFINITION_KEY_FACTOR + name(); + } + + public static List getConfigPropertyKeys() { + List list = new ArrayList(); + if (!DefaultOptionAction.skipDefault) { + for (MandatoryConfigProperty option : MandatoryConfigProperty.values()) { + list.add(option.getEntryKey()); + } + Collections.sort(list); + } + return list; + } + +}