From 5189762e8f99f9ca2b553be03a7d1bf5afc1d356 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 11 Feb 2015 13:54:13 -0700 Subject: [PATCH] Make spongy a real executable --- spongy/spongy.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spongy/spongy.go b/spongy/spongy.go index 7131003..83542a5 100644 --- a/spongy/spongy.go +++ b/spongy/spongy.go @@ -64,12 +64,22 @@ func runsvdir(dirname string) { } func usage() { - fmt.Fprintf(os.Stderr, "Usage: %s [OPTIONS] HOST:PORT\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s [OPTIONS] BASEPATH\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "BASEPATH is the path to your IRC directory (see README)\n") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "OPTIONS:\n") flag.PrintDefaults() } func main() { + flag.Usage = usage flag.UintVar(&maxlogsize, "logsize", 1000, "Log entries before rotating") flag.Parse() + if flag.NArg() != 1 { + usage() + os.Exit(2) + } + runsvdir(flag.Arg(0)) running = false }