+ trans(StringId.CLI_HELP_LANG));
System.out.println("\t--tui : " + trans(StringId.CLI_HELP_TUI));
System.out.println("\t--gui : " + trans(StringId.CLI_HELP_GUI));
- System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF));
+ System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF_OPTION));
System.out.println("\t--config : "
+ trans(StringId.CLI_HELP_CONFIG));
System.out.println();
* in case of IO error
*/
protected void writeValue(Writer writer, E id) throws IOException {
- writer.write(id.name());
+ writeValue(writer, id.name(), getString(id));
+ }
+
+ /**
+ * Write the given data to the config file, i.e.,
+ * "MY_ID = my_curent_value" followed by a new line
+ *
+ * @param writer
+ * the {@link Writer} to write into
+ * @param id
+ * the id to write
+ * @param value
+ * the id's value
+ *
+ * @throws IOException
+ * in case of IO error
+ */
+ protected void writeValue(Writer writer, String id, String value)
+ throws IOException {
+ writer.write(id);
writer.write(" = ");
- String[] lines = getString(id).replaceAll("\\\t", "\\\\\\t").split(
- "\n");
+ String[] lines = value.replaceAll("\\\t", "\\\\\\t").split("\n");
for (int i = 0; i < lines.length; i++) {
writer.write(lines[i]);
if (i < lines.length - 1) {
@Override
protected void writeValue(Writer writer, ColorOption id) throws IOException {
- writer.write(id.name() + "_FG");
- writer.write(" = ");
- if (map.containsKey(id.name() + "_FG"))
- writer.write(map.getString(id.name() + "_FG").trim());
+ String name = id.name() + "_FG";
+ String value = "";
+ if (map.containsKey(name))
+ value = map.getString(name).trim();
- writer.write("\n");
+ writeValue(writer, name, value);
- writer.write(id.name() + "_BG");
- writer.write(" = ");
- if (map.containsKey(id.name() + "_BG"))
- writer.write(map.getString(id.name() + "_BG").trim());
+ name = id.name() + "_BG";
+ value = "";
+ if (map.containsKey(name))
+ value = map.getString(name).trim();
- writer.write("\n");
+ writeValue(writer, name, value);
}
}
StringId.writeHeader(writer, name);
}
+ @Override
+ protected void writeValue(Writer writer, StringId id) throws IOException {
+ super.writeValue(writer, id);
+
+ String name = id.name() + "_NOUTF";
+ if (map.containsKey(name)) {
+ String value = map.getString(name).trim();
+ writeValue(writer, name, value);
+ }
+ }
+
/**
* Return the {@link Locale} representing the given language.
*
return locale;
}
-
}
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
CLI_HELP_TUI, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
- CLI_HELP_NOUTF, //
+ CLI_HELP_NOUTF_OPTION, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
CLI_HELP_CONFIG, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message footer about files and jvcard:// links")
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
+DEAULT_FIELD_SEPARATOR_NOUTF = |
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Invert colours
CLI_HELP_TUI = force text mode (and supports headless JRE)
# (WHAT: CLI --help)
# The Help message line for: --
-CLI_HELP_NOUTF = do not use UTF-8, prefer simple ASCII
+CLI_HELP_NOUTF_OPTION = do not use UTF-8, prefer simple ASCII
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = set the configuration directory to DIR
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
+DEAULT_FIELD_SEPARATOR_NOUTF = |
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Invert colours
CLI_HELP_TUI = force text mode (and supports headless JRE)
# (WHAT: CLI --help)
# The Help message line for: --
-CLI_HELP_NOUTF = do not use UTF-8, prefer simple ASCII
+CLI_HELP_NOUTF_OPTION = do not use UTF-8, prefer simple ASCII
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = set the configuration directory to DIR
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
+DEAULT_FIELD_SEPARATOR_NOUTF = |
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Couleurs inversées
CLI_HELP_TUI = force le mode texte (et supporte les JRE headless)
# (WHAT: CLI --help)
# The Help message line for: --
-CLI_HELP_NOUTF = évite l'utilisation de UTF-8, utilise le format ASCII
+CLI_HELP_NOUTF_OPTION = évite l'utilisation de UTF-8, utilise le format ASCII
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = cherche les fichiers de configuration dans DIR