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