Add support for repetitions of options with integer arguments

This commit adds support for a type of command-line options that are
commonly used by many GNU tools. Now with this modification if you
have an option named 'verbose' with an integer argument and you enter
"-vvv" as in the command line you'll get {verbose, 3} as a result.
This commit is contained in:
Juan Jose Comellas
2012-01-17 00:33:40 -03:00
parent 2379dc96b2
commit 9283bc0697
5 changed files with 122 additions and 84 deletions
+1
View File
@@ -46,5 +46,6 @@ option_spec_list() ->
{port, $p, "port", {integer, 1000}, "Database server port"},
{output_file, $o, "output-file", string, "File where the data will be saved to"},
{xml, $x, "xml", undefined, "Output data as XML"},
{verbose, $v, "verbose", integer, "Verbosity level"},
{dbname, undefined, undefined, string, "Database name"}
].