diff options
author | Simon Ser <contact@emersion.fr> | 2019-12-03 15:21:59 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-12-03 15:21:59 +0100 |
commit | ae79f998769cdd62dbf856db0b3b53528b532438 (patch) | |
tree | 41873bf524bf5fda96b693c1a9372244ee03e13b /cmd/koushin | |
parent | 1194b98e541cbe11af7c28e21590eb6d401fbaa0 (diff) | |
download | alps-ae79f998769cdd62dbf856db0b3b53528b532438.tar.gz alps-ae79f998769cdd62dbf856db0b3b53528b532438.zip |
Parse SMTP URL from CLI
Diffstat (limited to 'cmd/koushin')
-rw-r--r-- | cmd/koushin/main.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cmd/koushin/main.go b/cmd/koushin/main.go index 6e364cb..d30cb85 100644 --- a/cmd/koushin/main.go +++ b/cmd/koushin/main.go @@ -9,14 +9,19 @@ import ( ) func main() { - if len(os.Args) != 2 { - fmt.Println("usage: koushin imaps://<host>:<port>") + if len(os.Args) != 2 && len(os.Args) != 3 { + fmt.Println("usage: koushin <IMAP URL> [SMTP URL]") return } - url := os.Args[1] + imapURL := os.Args[1] - e := koushin.New(url) + var smtpURL string + if len(os.Args) == 3 { + smtpURL = os.Args[2] + } + + e := koushin.New(imapURL, smtpURL) e.Use(middleware.Logger()) e.Use(middleware.Recover()) e.Logger.Fatal(e.Start(":1323")) |