The command line arguments can now be passed as string.

This commit is contained in:
Juan Jose Comellas
2009-10-13 18:34:51 -03:00
parent 5a1d192b4a
commit 08392f62fe
3 changed files with 20 additions and 15 deletions
+2 -3
View File
@@ -184,9 +184,8 @@ parse_1_test_() ->
{ShortArg#option.help, ?_assertMatch({ok, {[{short_arg, "value"}], []}}, parse([ShortArg], [[$-, ShortArg#option.short], "value"]))},
{ShortDefArg#option.help, ?_assertMatch({ok, {[{short_def_arg, "default-short"}], []}}, parse([ShortDefArg], []))},
{ShortInt#option.help, ?_assertMatch({ok, {[{short_int, 100}], []}}, parse([ShortInt], [[$-, ShortInt#option.short], "100"]))},
{"Unsorted multiple short form options and arguments",
?_assertMatch({ok, {[short, short2, short3], ["arg1", "arg2"]}},
parse([Short, Short2, Short3], ["arg1", [$-, Short#option.short, Short2#option.short, Short3#option.short], "arg2"]))},
{"Unsorted multiple short form options and arguments in a single string",
?_assertMatch({ok, {[short, short2, short3], ["arg1", "arg2"]}}, parse([Short, Short2, Short3], "arg1 -abc arg2"))},
{"Short form option and arguments",
?_assertMatch({ok, {[short], ["arg1", "arg2"]}}, parse([Short], [[$-, Short#option.short], "arg1", "arg2"]))},
{"Short form option and arguments (unsorted)",