From e78563fdb372de12a1de9facfc6c8da2529b2b0f Mon Sep 17 00:00:00 2001 From: Brandon Wiley Date: Tue, 22 Nov 2016 10:55:16 -0600 Subject: Print usage when require parameters are missing --- shapeshifter-dispatcher/shapeshifter-dispatcher.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shapeshifter-dispatcher/shapeshifter-dispatcher.go b/shapeshifter-dispatcher/shapeshifter-dispatcher.go index 0addd8a..731f729 100644 --- a/shapeshifter-dispatcher/shapeshifter-dispatcher.go +++ b/shapeshifter-dispatcher/shapeshifter-dispatcher.go @@ -131,9 +131,11 @@ func main() { launched := false isClient, err := checkIsClient(*clientMode, *serverMode) if err != nil { + flag.Usage() golog.Fatalf("[ERROR]: %s - either --client or --server is required, or configure using PT 2.0 environment variables", execName) } if stateDir, err = makeStateDir(*statePath); err != nil { + flag.Usage() golog.Fatalf("[ERROR]: %s - No state directory: Use --state or TOR_PT_STATE_LOCATION environment variable", execName) } if err = log.Init(*enableLogging, path.Join(stateDir, dispatcherLogFile), *unsafeLogging); err != nil { -- cgit v1.2.3