summaryrefslogtreecommitdiff
path: root/cli_args_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cli_args_test.go')
-rw-r--r--cli_args_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli_args_test.go b/cli_args_test.go
index 8846491..63a33ef 100644
--- a/cli_args_test.go
+++ b/cli_args_test.go
@@ -12,6 +12,7 @@ type testcase struct {
o []string
}
+// TestPrefixOArgs checks that the "-o x,y,z" parsing works correctly.
func TestPrefixOArgs(t *testing.T) {
testcases := []testcase{
{
@@ -51,6 +52,15 @@ func TestPrefixOArgs(t *testing.T) {
i: []string{"gocryptfs", "-o", "rw", "--config", "fff", "ccc", "mmm"},
o: []string{"gocryptfs", "-rw", "--config", "fff", "ccc", "mmm"},
},
+ // "--" should also block "-o" parsing.
+ {
+ i: []string{"gocryptfs", "foo", "bar", "--", "-o", "a"},
+ o: []string{"gocryptfs", "foo", "bar", "--", "-o", "a"},
+ },
+ {
+ i: []string{"gocryptfs", "--", "-o", "a"},
+ o: []string{"gocryptfs", "--", "-o", "a"},
+ },
}
for _, tc := range testcases {
o := prefixOArgs(tc.i)