1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-25 18:06:15 +00:00

Reformatted the exporter selection part of CommandLineController.

This commit is contained in:
Fabian Schlenz 2018-04-11 06:24:24 +02:00
parent b5ff4dd1a6
commit 01590b05ee

View File

@ -126,15 +126,12 @@ class CommandLineController(val options: CommandLineOptions) {
System.exit(0) System.exit(0)
} }
val export = options.get("export") val export = options.get("export")?.toLowerCase()
logger.debug("options.val_export: {}", export) logger.debug("options.val_export: {}", export)
if (export != null) { when (export) {
if (export.toLowerCase() == "html") { "html" -> { HTMLExporter(database, user_manager, settings=settings, file_base=file_base).export(); System.exit(0) }
HTMLExporter(database, user_manager, settings=settings, file_base=file_base).export() null -> { /* No export whished -> do nothing. */ }
System.exit(0) else -> show_error("Unknown export format '${export}'.")
} else {
show_error("Unknown export format '${export}'.")
}
} }
println("You are logged in as ${user_manager.toString().anonymize()}") println("You are logged in as ${user_manager.toString().anonymize()}")