aboutsummaryrefslogtreecommitdiff
path: root/tools/print-cache/print-cache.go
blob: cdecac4083493cb1f2c476189801ff71aa786632 (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"
)

// 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 := feed.LoadCache(cacheFile)
	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())
	}
}
href='/portato.git/commit/portato.desktop?h=0.13&id=4460f9d840d1db191a030d24825df9f3c581d6fa&follow=1'> r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108