aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.go b/main.go
index 5ae8146..2033e23 100644
--- a/main.go
+++ b/main.go
@@ -214,6 +214,15 @@ func main() {
}
changePassword(&args) // does not return
}
- // Mount
+ // Default operation: mount.
+ if flagSet.NArg() != 2 {
+ prettyArgs := fmt.Sprintf("%q", os.Args[1:])
+ // Get rid of "[" and "]"
+ prettyArgs = prettyArgs[1 : len(prettyArgs)-1]
+ 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", tlog.ProgramName)
+ os.Exit(ErrExitUsage)
+ }
os.Exit(doMount(&args))
}