Implement initial entry adding (partial, missing notes support)

This commit is contained in:
2024-03-05 14:09:50 -05:00
parent b09a1c8132
commit f58c789c60
2 changed files with 51 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package cli
import (
"fmt"
"golang.org/x/crypto/ssh/terminal"
"os"
)
// input prompts the user for input and returns the input as a string
func input(prompt string) string {
fmt.Print("\n" + prompt)
var input string
fmt.Scanln(&input)
return input
}
// inputHidden prompts the user for input and returns the input as a string, hiding the input from the terminal
func inputHidden(prompt string) string {
fmt.Print("\n" + prompt)
byteInput, _ := terminal.ReadPassword(int(os.Stdin.Fd()))
password := string(byteInput)
fmt.Println()
return password
}