Skip to content

Commit

Permalink
Remove obsolete methods (#11272)
Browse files Browse the repository at this point in the history
* Remove obsolete method

* Remove obsolete CLI parameter "console"

* remove l10n

---------

Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
  • Loading branch information
koppor and Siedlerchr committed May 3, 2024
1 parent b4c4d4f commit 09683ed
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
24 changes: 0 additions & 24 deletions src/main/java/org/jabref/cli/JabRefCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ private static Options getOptions() {
options.addOption("v", "version", false, Localization.lang("Display version"));
options.addOption(null, "debug", false, Localization.lang("Show debug level messages"));

// The "-console" option is handled by the install4j launcher
options.addOption(null, "console", false, Localization.lang("Show console output (only when the launcher is used)"));

options.addOption(Option
.builder("i")
.longOpt("import")
Expand Down Expand Up @@ -372,25 +369,4 @@ protected static String alignStringTable(List<Pair<String, String>> table) {

return sb.toString();
}

/**
* Creates and wraps a multi-line and colon-seperated string from a List of Strings.
*/
protected static String wrapStringList(List<String> list, int firstLineIndentation) {
StringBuilder builder = new StringBuilder();
int lastBreak = -firstLineIndentation;

for (String line : list) {
if (((builder.length() + 2 + line.length()) - lastBreak) > WIDTH) {
builder.append(",\n");
lastBreak = builder.length();
builder.append(WRAPPED_LINE_PREFIX);
} else if (builder.length() > 0) {
builder.append(", ");
}
builder.append(line);
}

return builder.toString();
}
}
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,6 @@ Could\ not\ copy\ file=Could not copy file
Copied\ %0\ files\ of\ %1\ successfully\ to\ %2=Copied %0 files of %1 successfully to %2
Rename\ failed=Rename failed
JabRef\ cannot\ access\ the\ file\ because\ it\ is\ being\ used\ by\ another\ process.=JabRef cannot access the file because it is being used by another process.
Show\ console\ output\ (only\ when\ the\ launcher\ is\ used)=Show console output (only when the launcher is used)
Remove\ line\ breaks=Remove line breaks
Removes\ all\ line\ breaks\ in\ the\ field\ content.=Removes all line breaks in the field content.
Expand Down
13 changes: 0 additions & 13 deletions src/test/java/org/jabref/cli/JabRefCLITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,6 @@ void successfulParsingOfBibtexImportLong() throws Exception {
assertEquals(bibtex, cli.getBibtexImport());
}

@Test
void wrapStringList() {
List<String> given = List.of("html", "simplehtml", "docbook5", "docbook4", "din1505", "bibordf", "tablerefs", "listrefs",
"tablerefsabsbib", "harvard", "iso690rtf", "iso690txt", "endnote", "oocsv", "ris", "misq", "yaml", "bibtexml", "oocalc", "ods",
"MSBib", "mods", "xmp", "pdf", "bib");
String expected = """
Available export formats: html, simplehtml, docbook5, docbook4, din1505, bibordf, tablerefs,
listrefs, tablerefsabsbib, harvard, iso690rtf, iso690txt, endnote, oocsv, ris, misq, yaml, bibtexml,
oocalc, ods, MSBib, mods, xmp, pdf, bib""";

assertEquals(expected, "Available export formats: " + JabRefCLI.wrapStringList(given, 26));
}

@Test
void alignStringTable() {
List<Pair<String, String>> given = List.of(
Expand Down

0 comments on commit 09683ed

Please sign in to comment.