webweav.ing/cmd/cli/main.go

29 lines
610 B
Go
Raw Normal View History

2024-01-19 03:33:37 +00:00
package main
2024-01-19 04:29:12 +00:00
import (
"flag"
"fmt"
2024-01-22 20:43:46 +00:00
"os"
2024-01-19 04:29:12 +00:00
2024-03-03 21:10:34 +00:00
"git.32bit.cafe/yequari/webweav.ing/feed"
2024-01-19 04:29:12 +00:00
)
func main() {
siteUrl := flag.String("url", "", "url of site")
siteTitle := flag.String("title", "", "site title")
siteDesc := flag.String("desc", "", "site description")
flag.Parse()
if *siteUrl == "" || *siteTitle == "" || *siteDesc == "" {
flag.PrintDefaults()
2024-03-03 21:04:59 +00:00
os.Exit(1)
2024-01-19 04:29:12 +00:00
}
2024-03-03 21:04:59 +00:00
feedInfo, err := feed.NewFeedInfo(*siteTitle, *siteUrl, *siteDesc, "", flag.Args()...)
2024-01-22 20:43:46 +00:00
if err != nil {
os.Stderr.WriteString(err.Error())
2024-03-03 21:04:59 +00:00
os.Exit(1)
2024-01-22 20:43:46 +00:00
}
2024-03-03 21:04:59 +00:00
fmt.Println(feedInfo.GenerateRSS())
2024-01-19 04:29:12 +00:00
}