Juan Jose Comellas
63fd9ed7bc
Fix dialyzer warning
2013-07-18 22:06:24 -03:00
Juan Jose Comellas
3a15ecc1ac
Rearrange the arguments passed to check/2 to match existing conventions
2013-07-18 21:44:52 -03:00
serge
5c03bb75f3
Added functions check/2, parse_and_check/2, and format_error/2
2013-07-18 19:14:26 -04:00
Juan Jose Comellas
412ed1536b
Update version to 0.7.1
2013-03-28 16:18:31 -03:00
Juan Jose Comellas
86058fbdca
Use io_lib:format/2 instead of float_to_list/1 to display floats
...
Erlang's list_to_float/1 function will use scientific notation and add
additional less significant digits to the resulting string due to the
internal floating point representation. io_lib:format/2 rounds the
values to better match what the user normally expects. e.g.
> float_to_list(0.66).
"6.60000000000000031086e-01"
> io_lib:format("~w", [0.66]).
["0.66"]
2013-03-28 16:12:05 -03:00
Juan Jose Comellas
346c766b8c
Update version to 0.7.0
2013-01-25 15:33:23 -03:00
Juan Jose Comellas
94fb57a247
Fix line wrapping of usage output when the command line suffix is long
2013-01-25 15:30:56 -03:00
Juan Jose Comellas
8151b3f37d
The maximum width for the usage output is now 75 characters
2013-01-25 13:56:55 -03:00
Juan Jose Comellas
b9f1e63971
Update version to 0.6.0
2012-11-19 12:39:24 -03:00
Juan Jose Comellas
98f3c6f123
Fix usage output when a long option has a length that is bigger than a console line
2012-11-19 12:25:06 -03:00
Juan Jose Comellas
46ea9c7908
Fix #6 and #7 : wrap lines in usage output and add default arguments
2012-11-18 16:06:18 -03:00
Juan Jose Comellas
266caf429f
Update version to 0.5.2
2012-10-05 11:03:40 -03:00
Tuncer Ayaz
fe56a2618e
Fix Dialyzer warnings
2012-09-21 19:10:07 +02:00
Juan Jose Comellas
8073fa72a4
Update version to 0.5.1
2012-07-20 11:02:29 -03:00
Juan Jose Comellas
f55ef18bab
Expose getopt:tokenize/1 and command-line literals
2012-07-20 11:00:25 -03:00
Juan Jose Comellas
3f0ac07896
Update version to 0.5.0
2012-07-20 07:52:17 -03:00
Juan Jose Comellas
1a01b82531
Fix #15 : add command-line tokenizer with support for quoted arguments
...
Replace string:tokens/2 with a custom command-line tokenizer that supports
single and double-quoted arguments (with embedded whitespace) and
expansion of environment variables using either the Unix ($VAR; ${VAR}) or
Windows (%VAR%) formats. This tokenizer is only used when the command line
is parsed as a single string.
2012-07-20 07:42:23 -03:00
Juan Jose Comellas
eb4a5beccd
Update version to 0.4.4
2012-05-15 17:04:18 -03:00
Juan Jose Comellas
659a28f414
Upgrade version to 0.4.3
2012-04-16 13:13:43 -03:00
Tuncer Ayaz
7740b79fa5
Apply Tidier suggestion
2012-04-15 22:49:03 +02:00
Juan Jose Comellas
c8fc803ea8
Use the names given in Erlang to the stdio file descriptors (stdout; stderr)
2012-01-31 16:28:19 -03:00
Juan Jose Comellas
dfca05584d
Update version number
2012-01-29 12:43:56 -03:00
Juan Jose Comellas
e1f239785b
Make multiple repetitions with implicit arguments more 'intuitive'
2012-01-29 12:13:36 -03:00
Juan Jose Comellas
29b5665479
Add support for duplicated integer options and for negative integer/float arguments
2012-01-24 15:38:59 -03:00
Juan Jose Comellas
9ed277d788
Fix bug in case expression with invalid result
2012-01-17 10:42:31 -03:00
Juan Jose Comellas
51fc89bdda
Fix function spec to avoid dialyzer warnings
2012-01-17 09:41:41 -03:00
Juan Jose Comellas
9283bc0697
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.
2012-01-17 00:33:40 -03:00
Juan Jose Comellas
e745402fd3
Moved .app file to .app.src
2012-01-17 00:31:24 -03:00
Uwe Dauernheim
ca5eb9ad09
Allow usage message to be printed to stderr (default) as well as stdout
2012-01-06 00:19:16 +01:00
Juan Jose Comellas
1e75708497
Merge branch 'master' of https://github.com/ericbmerritt/getopt into ericbmerritt-master
...
Conflicts:
src/getopt.erl
2011-01-15 12:01:04 -03:00
Eric Merritt
0fda71a930
export declared types from getopt.erl
...
This patch exports the externally useful declared types so clients
may make use of them in thier codebase.
2011-01-12 18:13:25 -06:00
Tuncer Ayaz
f82e2989b1
Apply Tidier suggestions
2011-01-09 14:33:46 +01:00
Kostis Sagonas
1dd5a75277
Dialyzer related cleanups
2010-10-12 05:11:36 +08:00
Kostis Sagonas
91143ed4b3
Simplify macro
...
As a bonus it's also optimized.
2010-10-02 00:16:23 +08:00
Kostis Sagonas
76cebab9a9
Avoid unnecessary construction of deep strings
...
Especially when the -spec specifies that a string() is returned.
2010-10-02 00:16:23 +08:00
Juan Jose Comellas
5cde8b5e4b
Remove dialyzer warnings. Clean up comments.
2010-09-23 15:09:55 -03:00
Eric Merritt
ba7ae64d2a
Moved sub directories on source to top level
...
This allows for normal inclusion in OTP releases.
2010-08-12 09:47:49 +08:00
Juan Jose Comellas
b2e8bcd291
Modify module to make it GNU getopt compliant.
...
Add support for short options with embedded arguments (e.g. -j2).
Add support for implicit boolean options (e.g. -q -> {quiet, true}).
Add support for option terminator ("--").
2010-01-06 16:39:48 -03:00
Juan Jose Comellas
5ce0e76f87
Added support for embedded short options (e.g. -j2) and option
...
terminator (i.e. "--").
2010-01-05 19:21:34 -03:00
Juan Jose Comellas
2a42bd761c
Special case for boolean arguments to consider them enabled when the argument is missing.
2009-12-31 10:39:35 -03:00
Juan Jose Comellas
400a7b7cf9
Add support for options without a '-' prefix as required by rebar.
...
Boolean options without an argument are now considered true.
2009-12-30 20:12:54 -03:00
Juan Jose Comellas
a59893e9b9
Add support for options with embedded arguments without the '--' prefix.
...
e.g. "verbose=1"
2009-12-30 18:38:42 -03:00
Juan Jose Comellas
0329f560c4
Add support for embedded arguments with equal characters in them.
...
e.g. "--var=debug=1" --> {var, "debug=1"}
2009-12-30 18:11:25 -03:00
Juan Jose Comellas
d26cb9df09
Add support for arguments assigned to options with an equal ('=')
...
character within the option string. e.g. "--port=1000".
2009-12-30 17:20:35 -03:00
Juan Jose Comellas
4b03285d9e
Dropped record syntax for the option specifications to simplify use from escripts.
2009-11-16 19:20:32 -03:00
Juan Jose Comellas
109d9f5f2a
Cleaned up code.
2009-10-13 19:21:57 -03:00
Juan Jose Comellas
1da93693e2
Cleaned up code.
2009-10-13 19:18:46 -03:00
Juan Jose Comellas
cfae6a2abf
Added BSD license.
2009-10-13 19:08:39 -03:00
Juan Jose Comellas
4c715eaa94
Added example file and make target.
2009-10-13 18:35:23 -03:00
Juan Jose Comellas
08392f62fe
The command line arguments can now be passed as string.
2009-10-13 18:34:51 -03:00