accept username/password
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user