Bump libmutton & support new password generation options; bump other dependencies

This commit is contained in:
2025-04-21 12:19:56 -04:00
parent 8166bfcfbe
commit 34136633d9
5 changed files with 55 additions and 40 deletions
+16
View File
@@ -64,6 +64,22 @@ func inputMenuGen(prompt string, options []string) int {
return inputInt(prompt, len(options))
}
// inputPasswordGen prompts the user for password generation parameters and returns a generated password as a string.
func inputPasswordGen() string {
passLength := inputInt("Password length:", -1)
passCharset := uint8(inputMenuGen("Password complexity:", []string{"Simple", "Complex", "Ultra Complex (not compatible with many services)"}))
var complexity float64
switch passCharset {
case 1:
complexity = 0 // simple
// 1 indicates string gen for filenames, but since complexity is 0, only the base charset is used
default:
complexity = 0.2 // (ultra) complex
// 2 and 3 indicate complex and ultra complex charsets, respectively
}
return core.StringGen(passLength, complexity, passCharset)
}
// writeEntryCLI writes an entry to targetLocation and previews it (errors if no data is supplied).
func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets bool) {
if core.EntryIsNotEmpty(unencryptedEntry) {