Mercurial > go > multipass
view multipass-add.go @ 0:c18bc7b9d1d9
Basic binaries. checkpassword doesn't yet work.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sat, 24 Oct 2015 21:32:03 -0400 |
parents | |
children | faf4aad86fc9 |
line wrap: on
line source
// multipass-add allows a user to add an entry to their multipass database. package main import ( "bufio" "fmt" "os" "pfish.zone/go/multipass/auth" "pfish.zone/go/multipass/file" ) func main() { passfile, err := file.ForMe() reader := bufio.NewReader(os.Stdin) fmt.Print("Describe password: ") text, err := reader.ReadString('\n') if err != nil { fmt.Println(err.Error()) return } entry, password, err := auth.NewEntry(text) if err != nil { fmt.Println(err.Error()) return } passfile.Add(entry) fmt.Printf("New password: %s\n", password) }