accept username/password
parent
2313cc3ac5
commit
48cb9bf32b
|
|
@ -16,12 +16,16 @@ func main() {
|
|||
as := args.NewArgSet()
|
||||
as.Append(args.STRING, "imap", "imap server:port", "imap.gmail.com:993")
|
||||
as.Append(args.INT, "n", "limit (<1 for inf)", 10)
|
||||
as.Append(args.STRING, "u", "username", emailer.From)
|
||||
as.Append(args.STRING, "p", "password", emailer.Password)
|
||||
if err := as.Parse(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
emailer.IMAP = as.Get("imap").GetString()
|
||||
emailer.Limit = as.Get("n").GetInt()
|
||||
emailer.From = as.GetString("u")
|
||||
emailer.Password = as.GetString("p")
|
||||
|
||||
msgs, err := emailer.Read()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue