From f5d3efc1f3b99e5cb008f05231a2b868e3dcb39e Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Sun, 28 Feb 2016 16:31:27 +0100 Subject: [PATCH] Changing default values for CLI to allow season=0 --- gparser/cli.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gparser/cli.go b/gparser/cli.go index c3e6516..22fadcb 100644 --- a/gparser/cli.go +++ b/gparser/cli.go @@ -27,32 +27,32 @@ var oldslug string var newseason int64 func InitCli() { - flag.StringVar(&mode, "mode", "", "Specifies the action to be done. Can be add_lt and merge_lps") + flag.StringVar(&mode, "mode", "null", "Specifies the action to be done. Can be add_lt and merge_lps") // For add_lt - flag.StringVar(&slug, "slug", "", "Slug as it would be on gronkh.de") - flag.StringVar(&name, "name", "", "Name as it would be on gronkh.de") - flag.StringVar(&aslug, "author", "", "Author slug") - flag.StringVar(&youtubeid, "youtube", "", "YouTube ID of the video") - flag.StringVar(&poster, "poster", "", "Poster URL that should be used") + flag.StringVar(&slug, "slug", "null", "Slug as it would be on gronkh.de") + flag.StringVar(&name, "name", "null", "Name as it would be on gronkh.de") + flag.StringVar(&aslug, "author", "null", "Author slug") + flag.StringVar(&youtubeid, "youtube", "null", "YouTube ID of the video") + flag.StringVar(&poster, "poster", "null", "Poster URL that should be used") // For merge_lps - flag.StringVar(&newslug, "newslug", "", "Slug of the final LP") - flag.StringVar(&oldslug, "oldslug", "", "Current slug of LP to be merged") - flag.Int64Var(&newseason, "newseason", 0, "Season the episodes of the old LP will become") + flag.StringVar(&newslug, "newslug", "null", "Slug of the final LP") + flag.StringVar(&oldslug, "oldslug", "null", "Current slug of LP to be merged") + flag.Int64Var(&newseason, "newseason", -1, "Season the episodes of the old LP will become") } func DoCli() { flag.Parse() - if mode != "" { + if mode != "null" { if mode == "add_lt" { - if (slug == "" || name == "" || aslug == "" || youtubeid == "" || poster == "") { + if (slug == "null" || name == "null" || aslug == "null" || youtubeid == "null" || poster == "null") { log.Fatalf("slug, name, author, youtube, poster must be specified") } ParseCliLT() } else if mode == "merge_lps" { - if (oldslug == "" || newslug == "" || newseason == 0) { + if (oldslug == "null" || newslug == "null" || newseason == -1) { log.Fatalf("oldslug, newslug, newseason must be specified") } MergeLPs()