Main // Allow dumping UserDefaults through terminal.

This commit is contained in:
ShikiSuen 2023-12-01 00:09:20 +08:00
parent 82dea233b6
commit a8e72c902b
1 changed files with 11 additions and 10 deletions

View File

@ -16,18 +16,19 @@ switch max(CommandLine.arguments.count - 1, 0) {
case 0: break case 0: break
case 1, 2: case 1, 2:
switch CommandLine.arguments[1] { switch CommandLine.arguments[1] {
case "--dump-prefs":
if let strDumpedPrefs = PrefMgr.shared.dumpShellScriptBackup() {
print(strDumpedPrefs)
}
exit(0)
case "install": case "install":
if CommandLine.arguments[1] == "install" {
let exitCode = IMKHelper.registerInputMethod() let exitCode = IMKHelper.registerInputMethod()
exit(exitCode) exit(exitCode)
}
case "uninstall": case "uninstall":
if CommandLine.arguments[1] == "uninstall" {
let exitCode = Uninstaller.uninstall( let exitCode = Uninstaller.uninstall(
isSudo: NSApplication.isSudoMode, defaultDataFolderPath: LMMgr.dataFolderPath(isDefaultFolder: true) isSudo: NSApplication.isSudoMode, defaultDataFolderPath: LMMgr.dataFolderPath(isDefaultFolder: true)
) )
exit(exitCode) exit(exitCode)
}
default: break default: break
} }
exit(0) exit(0)