From 9f0793ab0f7f73f8829cb86d6a645fd01eaa6849 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 9 Oct 2016 20:55:33 +0200 Subject: main: more useful error message on unknown flag --- main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 6d03ee2..c5675e2 100644 --- a/main.go +++ b/main.go @@ -216,9 +216,7 @@ func main() { } // Default operation: mount. if flagSet.NArg() != 2 { - prettyArgs := fmt.Sprintf("%q", os.Args[1:]) - // Get rid of "[" and "]" - prettyArgs = prettyArgs[1 : len(prettyArgs)-1] + prettyArgs := prettyArgs() tlog.Info.Printf("Wrong number of arguments (have %d, want 2). You passed: %s", flagSet.NArg(), prettyArgs) tlog.Fatal.Printf("Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]", tlog.ProgramName) -- cgit v1.2.3