Commit Graph
51 Commits
Author SHA1 Message Date
José Valim 83ccde4db6 Update CHANGELOG, fix tests and typespecs 2014-05-22 11:29:42 +02:00
Alexei Sholik 4cc28c2e8c Return invalid options as strings 2014-05-22 00:05:41 +03:00
José Valim 927594bb14 Always return nil for undefined options (#2308) 2014-05-21 21:09:01 +02:00
Alexei Sholik a9375903ae Do not assume invalid options are of boolean type 2014-05-21 17:36:19 +03:00
Alexei Sholik fb2686fe37 Parse "-" as a plain argument 2014-05-21 13:55:28 +03:00
José Valim cb0c3d8a2a Support :strict option on parse and improve return types 2014-05-21 11:50:11 +02:00
Alexei Sholik 142ebc3ecd Fix handling of boolean options with bad values 2014-05-20 17:32:12 +03:00
Alexei Sholik 339c57f1c6 Fix value normalization in strict mode 2014-05-20 17:32:12 +03:00
Alexei Sholik 76260b057f Refactor option parsing internals to support strict mode 2014-05-20 17:32:12 +03:00
Alexei Sholik 40a384aef6 Tentative implementation of the next function 2014-05-20 17:32:12 +03:00
Aleksei Magusev c0bc64fb19 Change OptionParser to remove the end of command options (--) 2014-05-20 12:49:10 +04:00
José Valim 540c763c85 Move binary and list conversions to String and List 2014-05-17 17:02:46 +02:00
Alexei Sholik 79bb046ad6 Fix unused variable warning 2014-05-12 21:33:04 +03:00
Alexei Sholik 2187db5415 Don’t ignore values for ‘--no-*’ options 2014-05-12 21:24:31 +03:00
Alexei Sholik 95ed007b1c Properly handle non-boolean values for boolean options 2014-05-12 21:24:31 +03:00
Aleksei Magusev 698d1f6440 Fix handling of end of command options (--) in OptionParser 2014-05-10 20:10:23 +04:00
José Valim d53a6a3491 Ensure string switches are not treated as booleans, closes #2218 2014-04-30 12:48:39 +02:00
José Valim 56f15d9f4e Do not add spaces after { and before }
This makes the source code consistent with the result
returned by inspect/2.
2014-04-21 19:06:35 +02:00
Augie De Blieck Jr. bb02b25e49 Small grammar fix 2014-04-17 15:21:53 -04:00
Igor Kapkov 97e70e6de1 change some doc examples to iex style 2014-04-12 08:41:22 +02:00
José Valim fd8859abdd Do not recognize undefined aliases as switches 2014-02-17 15:52:44 +01:00
José Valim bf3852b7bd Migrate from bc to for comprehensions 2014-02-17 14:53:45 +01:00
José Valim fe2e4a1010 Move from // to \\ 2014-01-28 10:50:00 +01:00
José Valim 27467bdb67 Fix spelling of overridden 2014-01-05 12:28:11 +01:00
José Valim 429548ea75 Remove pid conversions from Kernel, clean up String conversions 2013-10-18 19:16:17 +02:00
parroty f2066e0ea9 Add underscore for avoiding variable unused warning 2013-08-17 12:02:48 +09:00
José Valim aaebf84440 Always stop on --, even for parse 2013-08-16 09:28:58 +02:00
José Valim 4eb98a83e5 Clean up option parser 2013-08-11 12:38:47 +02:00
Thomaz Leite 0187f31520 Converge store_option and validate_option in OptionParser 2013-08-09 09:52:15 -07:00
Thomaz Leite 9fa7f0810f Change OptionParser to always permanent invalid list
The tuple returned from OptionParser now always includes the third element (invalid options list).
2013-08-09 09:52:15 -07:00
Thomaz Leite 770a7880c2 Add documentation for invalid switches 2013-08-09 09:52:15 -07:00
Thomaz Leite edfacf0c2f Use list concatenation operator instead of function 2013-08-09 09:52:15 -07:00
Thomaz Leite 06bc04a7bf Improve OptionParser switch validation
This adds a third element to the tuple returned from OptionParser.parse/2 when the value for an option doesn't match its switch type.
2013-08-09 09:52:15 -07:00
José Valim aad42261cc Document dash to underscore in OptionParser 2013-08-04 23:17:35 +02:00
José Valim 456b84616c mix run now properly sets System.argv 2013-07-27 10:17:02 +02:00
José Valim d77d013b32 Support --color option in ExUnit
The option can also be passed via mix, closes #1364
2013-07-25 12:31:18 +02:00
José Valim 1f76fb5246 Fix a bug on OptionParser where missing options appeared on the final result 2013-07-20 13:01:44 +02:00
John Warwick e4ddfc2118 Fixed doc typos in OptionParser 2013-07-10 18:05:31 -04:00
José Valim ebe522ec50 Tighten up the grammar rules regarding parentheses omission
Prior to this commit, Elixir allowed too many ambiguous calls
by ommitting the parentheses:

    do_something 1, is_list [], 3
    [1, is_atom :foo, 3]

Both cases above would lead to a compilation error, as an attempt
to call is_list/2 and is_atom/2 would happen. Those examples will
now raise a syntax error, pointing to the ambiguous location.

We have disallowed such examples throughout the language with
the exception of one argument calls:

    assert is_list []

Examples as above are extremely frequent and were kept as is.
2013-07-04 18:48:55 +02:00
José Valim 46e898e413 Add mix test --debug 2013-07-01 15:02:57 +02:00
José Valim a8ab6b5a2a Deprecate List.member?/2 in favor of Enum.member?/2 2013-05-05 10:10:03 -06:00
Yurii Rashkovskii 26599e7812 Improve elixir application doctest coverage 2013-04-11 08:25:17 -07:00
José Valim 683153ef05 Switches are now overridden by default but can be kept in order if chosen, closes #782 2013-02-16 19:17:35 -07:00
José Valim 3a1fbde95d Remove deprecated branches 2013-01-28 13:08:18 -07:00
alexrp c9908a23dd The pipeline operator is now '|>'.
Fixes #718.
2013-01-07 23:38:55 +01:00
José Valim 2bd71f7604 Improve how exceptions are handled in general
* raise expects an explicit stacktrace in order to re-raise
* the Exception module now holds function for both stacktrace
  manipulation and interface with erlang exceptions
* exceptions have their default functions with doc set to false
2012-12-31 13:33:30 +01:00
José Valim e353b1ad15 :flags option was deprecated in favor of :switches to support many types
Closes #710
2012-12-10 09:12:24 +01:00
José Valim d305c96762 Keep arguments order on OptionParser 2012-10-31 12:40:03 +01:00
José Valim 26204441bb Implement new bitstring syntax, closes #421 2012-09-10 13:45:45 +02:00
José Valim a00c64681d Add Enum.reverse 2012-08-09 08:53:48 -03:00