Skip to content

Commit ff94dc4

Browse files
committed
Update command-line error message, and make it a string
1 parent 071f3d1 commit ff94dc4

4 files changed

Lines changed: 20 additions & 23 deletions

File tree

schemacrawler-commandline/src/main/java/schemacrawler/tools/commandline/utility/CommandLineUtility.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package schemacrawler.tools.commandline.utility;
1010

1111
import static java.util.Objects.requireNonNull;
12-
import static us.fatehi.utility.IOUtility.readResourceFully;
1312
import static us.fatehi.utility.Utility.isBlank;
1413

1514
import java.io.PrintWriter;
@@ -173,14 +172,29 @@ public static CommandLine newCommandLine(final Object object, final IFactory fac
173172

174173
public static void printCommandLineErrorMessage(
175174
final String errorMessage, final ShellState state) {
175+
176+
final String errorHelpMessage =
177+
"""
178+
Run SchemaCrawler again with just the
179+
-h
180+
option for help
181+
182+
Or, run SchemaCrawler again with an additional
183+
--log-level=CONFIG
184+
option for details on the error
185+
186+
Additional resources are on the SchemaCrawler website
187+
https://www.schemacrawler.com
188+
""";
189+
176190
System.err.printf("%s%n%n", Version.version());
177191
if (!isBlank(errorMessage)) {
178192
System.err.printf("Error: %s%n%n", errorMessage);
179193
} else {
180194
System.err.printf("Error: Unknown error%n%n");
181195
}
182196

183-
System.err.println(readResourceFully("/command-line-error.footer.txt"));
197+
System.err.println(errorHelpMessage);
184198

185199
System.err.println();
186200
System.err.println(CommandLineUtility.getEnvironment(state));

schemacrawler-commandline/src/main/resources/command-line-error.footer.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

schemacrawler-commandline/src/test/resources/metadata_retrieval_strategy_output/overrideMetadataRetrievalStrategyDataDictionary.stderr.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SchemaCrawler 16.21.3
1+
SchemaCrawler 17.11.2
22

33
Error: No tables SQL provided
44

@@ -10,14 +10,12 @@ Or, run SchemaCrawler again with an additional
1010
--log-level=CONFIG
1111
option for details on the error
1212

13-
Additional resources are on the SchemaCrawler website,
13+
Additional resources are on the SchemaCrawler website
1414
https://www.schemacrawler.com
15-
and a live, interactive tutorial is on
16-
https://killercoda.com/schemacrawler
1715

1816

1917
Environment:
20-
SchemaCrawler 16.21.3
18+
SchemaCrawler 17.11.2
2119
Windows 10 10.0
2220
Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 1.8.0_151-b12
2321
JVM Architecture 64-bit x86-64 (amd64)

schemacrawler-dbtest/src/test/java/schemacrawler/integration/test/DuckDBTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
import us.fatehi.utility.IOUtility;
3333

3434
@DisableLogging
35-
@DisabledOnOs(
36-
value = OS.WINDOWS,
37-
architectures = {"arm64"},
38-
disabledReason = "DuckDB does not run on Windows ARM")
35+
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "DuckDB does not run on Windows ARM")
3936
public class DuckDBTest extends BaseAdditionalDatabaseTest {
4037

4138
@BeforeEach

0 commit comments

Comments
 (0)