blob: ef1d8e5a4f1e8132f4963c870a66170b2538ae74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package main
import (
"flag"
"fmt"
"log"
"github.com/Necoro/feed2imap-go/internal/feed/cache"
)
// flags
var (
cacheFile string = "feed.cache"
feedId string = ""
)
func init() {
flag.StringVar(&cacheFile, "c", cacheFile, "cache file")
flag.StringVar(&feedId, "i", feedId, "id of the feed")
}
func main() {
flag.Parse()
cache, err := cache.Load(cacheFile, false)
if err != nil {
log.Fatal(err)
}
defer cache.Unlock()
fmt.Printf("Cache version %d\n", cache.Version())
if feedId != "" {
fmt.Print(cache.SpecificInfo(feedId))
} else {
fmt.Print(cache.Info())
}
}
|