Skip to content

Commit 8eac055

Browse files
committed
updated usage note for config template generator
1 parent ea43a45 commit 8eac055

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

patch-gen/src/main/java/org/jboss/as/patching/generator/TemplateGenerator.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@
3939
*/
4040
class TemplateGenerator {
4141

42-
private static final String TAB = " ";
42+
private static final String APPLIES_TO_VERSION = "--applies-to-version";
43+
private static final String CREATE_TEMPLATE = "--create-template";
44+
private static final String CUMULATIVE = "--cumulative";
45+
private static final String DEFAULT_OPTIONAL_PATHS = "--default-optional-paths";
46+
private static final String H = "-h";
47+
private static final String HELP = "--help";
48+
private static final String ONE_OFF = "--one-off";
49+
private static final String STD_OUT = "--std.out";
50+
private static final String TAB = " ";
4351

4452
static void generate(final String... args) throws IOException {
4553

@@ -53,32 +61,32 @@ static void generate(final String... args) throws IOException {
5361
for (int i = 0; i < argsLength; i++) {
5462
final String arg = args[i];
5563
try {
56-
if ("--help".equals(arg) || "-h".equals(arg) || "-H".equals(arg)) {
64+
if (HELP.equals(arg) || H.equalsIgnoreCase(arg)) {
5765
usage();
5866
return;
59-
} else if(arg.equals("--one-off")) {
67+
} else if(arg.equals(ONE_OFF)) {
6068
if (oneOff == null) {
6169
oneOff = Boolean.TRUE;
6270
patchID = args[++i];
6371
} else {
6472
usage();
6573
return;
6674
}
67-
} else if(arg.equals("--cumulative")) {
75+
} else if(arg.equals(CUMULATIVE)) {
6876
if (oneOff == null) {
6977
oneOff = Boolean.FALSE;
7078
patchID = args[++i];
7179
} else {
7280
usage();
7381
return;
7482
}
75-
} else if(arg.equals("--applies-to-version")) {
83+
} else if(arg.equals(APPLIES_TO_VERSION)) {
7684
appliesToVersion = args[++i];
77-
} else if(arg.equals("--std.out")) {
85+
} else if(arg.equals(STD_OUT)) {
7886
stdout = true;
79-
} else if (arg.equals("--create-template")) {
87+
} else if (arg.equals(CREATE_TEMPLATE)) {
8088
continue;
81-
} else if (arg.equals("--default-optional-paths")) {
89+
} else if (arg.equals(DEFAULT_OPTIONAL_PATHS)) {
8290
defaultOptionalPaths = true;
8391
} else {
8492
System.err.println(PatchLogger.ROOT_LOGGER.argumentExpected(arg));
@@ -218,8 +226,8 @@ private static void writeStart(BufferedWriter writer, int offset, String name, b
218226

219227
static void usage() {
220228
System.err.println("USAGE:");
221-
System.err.println("patch-gen.sh --create-template --one-off [patch-id]");
222-
System.err.println("patch-gen.sh --create-template --cumulative [patch-id]");
229+
System.err.println("patch-gen.sh --create-template --one-off [patch-id] [" + DEFAULT_OPTIONAL_PATHS + "]");
230+
System.err.println("patch-gen.sh --create-template --cumulative [patch-id] [" + APPLIES_TO_VERSION + "] [" + DEFAULT_OPTIONAL_PATHS + "]");
223231
System.err.println();
224232
System.err.println("this will create a patch-config-[patch-id].xml");
225233
System.err.println("if this is not desired just append --std.out");

0 commit comments

Comments
 (0)