summaryrefslogtreecommitdiff
path: root/comitium.go
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-03-20 09:55:51 -0600
committernytpu <alex@nytpu.com>2021-03-20 09:59:50 -0600
commitd342b6f542ebe4f8766315f262cf764f6ac52de4 (patch)
tree6e624c51c277e4e94935b131dccefeb779ab5982 /comitium.go
parentfece24eed984978d47120d676a2a70020a871485 (diff)
add regenerate command
Diffstat (limited to 'comitium.go')
-rw-r--r--comitium.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/comitium.go b/comitium.go
index 418e220..7a02521 100644
--- a/comitium.go
+++ b/comitium.go
@@ -67,6 +67,18 @@ func main() {
fmt.Fprintf(os.Stderr, "Error writing feed: %v\n", err)
os.Exit(1)
}
+ case "regenerate":
+ argCheck(c.Args(), 0, false, "'regenerate' doesn't take an argument!")
+ err = core.Data.WriteSubs(dataPath)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "Error writing subscriptions: %v\n", err)
+ os.Exit(1)
+ }
+ err = core.Data.WriteFeed(dataPath)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "Error writing feed: %v\n", err)
+ os.Exit(1)
+ }
case "add":
argCheck(c.Args(), 1, true, "Please provide a URL to add.")