|
@@ -21,9 +21,10 @@ import (
|
|
|
)
|
|
|
|
|
|
type opts struct {
|
|
|
- Refresh time.Duration `short:"r" long:"refresh" env:"REFRESH" default:"30s" description:"refresh interval"`
|
|
|
- TimeOut time.Duration `short:"t" long:"timeout" env:"TIMEOUT" default:"5s" description:"rss feed timeout"`
|
|
|
- Feed string `short:"f" long:"feed" env:"FEED" required:"true" description:"rss feed url"`
|
|
|
+ Refresh time.Duration `short:"r" long:"refresh" env:"REFRESH" default:"30s" description:"refresh interval"`
|
|
|
+ TimeOut time.Duration `short:"t" long:"timeout" env:"TIMEOUT" default:"5s" description:"rss feed timeout"`
|
|
|
+ Feed string `short:"f" long:"feed" env:"FEED" required:"true" description:"rss feed url"`
|
|
|
+ IncludeFirst bool `long:"include-first" description:"start from the last current item, not with the next one"`
|
|
|
|
|
|
Dry bool `long:"dry" env:"DRY" description:"dry mode"`
|
|
|
Dbg bool `long:"dbg" env:"DEBUG" description:"debug mode"`
|
|
@@ -140,7 +141,7 @@ func main() {
|
|
|
}
|
|
|
|
|
|
func setup(o opts) (n notifier, pub Publisher, err error) {
|
|
|
- n = &rss.Notify{Feed: o.Feed, Duration: o.Refresh, Timeout: o.TimeOut}
|
|
|
+ n = &rss.Notify{Feed: o.Feed, Duration: o.Refresh, Timeout: o.TimeOut, IncludeFirst: o.IncludeFirst}
|
|
|
if o.Dry {
|
|
|
pub = Stdout{}
|
|
|
} else {
|