[jOOQ/jOOQ#11932] CLI APIs should log more helpful error messages on NoClassDefFoundError
This commit is contained in:
parent
5d1d7cff2c
commit
0871c7b33c
@ -51,22 +51,23 @@ import org.jooq.impl.DSL;
|
||||
public final class DiffCLI {
|
||||
|
||||
public static final void main(String... args) throws Exception {
|
||||
Args a;
|
||||
Settings settings = new Settings();
|
||||
DSLContext ctx;
|
||||
CLIUtil.main("https://www.jooq.org/doc/latest/manual/sql-building/schema-diff-cli/", () -> {
|
||||
Args a;
|
||||
Settings settings = new Settings();
|
||||
DSLContext ctx;
|
||||
|
||||
a = parse(args);
|
||||
settings(a, settings);
|
||||
ctx = ctx(a, settings);
|
||||
a = parse(args);
|
||||
settings(a, settings);
|
||||
ctx = ctx(a, settings);
|
||||
|
||||
if (a.done) {}
|
||||
else if (a.toDialect == null || a.sql1 == null || a.sql2 == null) {
|
||||
System.out.println("Mandatory arguments: -T and -1, -2. Use -h for help");
|
||||
throw new RuntimeException();
|
||||
}
|
||||
else {
|
||||
render(ctx, a);
|
||||
}
|
||||
if (a.done) {}
|
||||
else if (a.toDialect == null || a.sql1 == null || a.sql2 == null) {
|
||||
System.out.println("Mandatory arguments: -T and -1, -2. Use -h for help");
|
||||
throw new RuntimeException();
|
||||
}
|
||||
else
|
||||
render(ctx, a);
|
||||
});
|
||||
}
|
||||
|
||||
private static final DSLContext ctx(Args a, Settings settings) {
|
||||
|
||||
@ -64,25 +64,26 @@ public final class ParserCLI {
|
||||
private static final Pattern FLAG = Pattern.compile("^/([\\w\\-]+)(?:\\s+(\\w+))?\\s*$");
|
||||
|
||||
public static final void main(String... args) throws Exception {
|
||||
Args a;
|
||||
Settings settings = new Settings();
|
||||
DSLContext ctx;
|
||||
CLIUtil.main("https://www.jooq.org/doc/latest/manual/sql-building/sql-parser/sql-parser-cli/", () -> {
|
||||
Args a;
|
||||
Settings settings = new Settings();
|
||||
DSLContext ctx;
|
||||
|
||||
a = parse(args);
|
||||
settings(a, settings);
|
||||
ctx = ctx(a, settings);
|
||||
a = parse(args);
|
||||
settings(a, settings);
|
||||
ctx = ctx(a, settings);
|
||||
|
||||
if (a.interactive || args == null || args.length == 0) {
|
||||
interactiveMode(ctx, a);
|
||||
}
|
||||
else if (a.done) {}
|
||||
else if (a.toDialect == null || a.sql == null) {
|
||||
System.out.println("Mandatory arguments: -T and -s. Use -h for help");
|
||||
throw new RuntimeException();
|
||||
}
|
||||
else {
|
||||
render(ctx, a);
|
||||
}
|
||||
if (a.interactive || args == null || args.length == 0) {
|
||||
interactiveMode(ctx, a);
|
||||
}
|
||||
else if (a.done) {}
|
||||
else if (a.toDialect == null || a.sql == null) {
|
||||
System.out.println("Mandatory arguments: -T and -s. Use -h for help");
|
||||
throw new RuntimeException();
|
||||
}
|
||||
else
|
||||
render(ctx, a);
|
||||
});
|
||||
}
|
||||
|
||||
private static final DSLContext ctx(Args a, Settings settings) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user