forked from jason/cpolis
Added title, link and description to cli args.
This commit is contained in:
@ -7,14 +7,17 @@ import (
|
||||
)
|
||||
|
||||
type CliArgs struct {
|
||||
DBName string
|
||||
Domain string
|
||||
KeyFile string
|
||||
LogFile string
|
||||
Port string
|
||||
PicsDir string
|
||||
RSSFile string
|
||||
WebDir string
|
||||
Description string
|
||||
DBName string
|
||||
Domain string
|
||||
KeyFile string
|
||||
Link string
|
||||
LogFile string
|
||||
Port string
|
||||
PicsDir string
|
||||
RSSFile string
|
||||
Title string
|
||||
WebDir string
|
||||
}
|
||||
|
||||
func HandleCliArgs() (*CliArgs, error) {
|
||||
@ -22,12 +25,15 @@ func HandleCliArgs() (*CliArgs, error) {
|
||||
cliArgs := new(CliArgs)
|
||||
|
||||
flag.StringVar(&cliArgs.DBName, "db", "cpolis", "DB name")
|
||||
flag.StringVar(&cliArgs.Description, "desc", "Description", "Channel description")
|
||||
flag.StringVar(&cliArgs.Domain, "domain", "", "domain name")
|
||||
keyFile := flag.String("key", "/var/www/cpolis/cpolis.key", "key file")
|
||||
flag.StringVar(&cliArgs.Link, "link", "Link", "Channel Link")
|
||||
logFile := flag.String("log", "/var/log/cpolis.log", "log file")
|
||||
flag.StringVar(&cliArgs.PicsDir, "pics", "pics", "pictures directory")
|
||||
port := flag.Int("port", 8080, "port")
|
||||
rssFile := flag.String("rss", "/var/www/cpolis/cpolis.rss", "RSS file")
|
||||
flag.StringVar(&cliArgs.Title, "title", "Title", "Channel title")
|
||||
webDir := flag.String("web", "/var/www/cpolis/web", "web directory")
|
||||
flag.Parse()
|
||||
|
||||
|
Reference in New Issue
Block a user