annotate src/main/kotlin/name/blackcap/passman/Ask.kt @ 25:131e39d96862
Fix erroneous help message in read subcommand.
author |
David Barts <n5jrn@me.com> |
date |
Thu, 04 Jul 2024 09:49:36 -0700 |
parents |
a38a2a1036c3 |
children |
|
rev |
line source |
12
|
1 package name.blackcap.passman
|
|
2
|
|
3 fun askUserIfOkToOverwrite(thisEntry: Entry, otherEntry: Entry): Boolean {
|
|
4 val REDACTED = "(redacted)"
|
|
5 println("EXISTING ENTRY:")
|
|
6 thisEntry.printLong(REDACTED)
|
|
7 println()
|
|
8 println("NEWER ENTRY:")
|
|
9 otherEntry.printLong(REDACTED)
|
|
10 println()
|
|
11 val answer = name.blackcap.passman.readLine("OK to overwrite existing entry? ")
|
|
12 println()
|
|
13 return answer.trimStart().firstOrNull()?.uppercaseChar() in setOf('T', 'Y')
|
|
14 }
|