summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cedar.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/cedar.go b/cedar.go
index 51159d1..8187373 100644
--- a/cedar.go
+++ b/cedar.go
@@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"encoding/xml"
+ "flag"
"io"
"net/http"
"os"
@@ -28,6 +29,11 @@ type Feed struct {
type Ids []string
+func init() {
+ var emailTo string
+ flag.StringVar(&emailTo, "t", "", "Email address for sending emails to")
+}
+
func newsFeed() ([]byte, error) {
// Init feed.
feed := make([]byte, 0)
@@ -201,4 +207,12 @@ func processNews() error {
return nil
}
-func main() {}
+func main() {
+ flag.Parse()
+
+ // Quit if emailTo is not set.
+ if flag.NFlag() != 1 {
+ flag.PrintDefaults()
+ return
+ }
+}