lib/opts: do not crash for empty arguments
authorJean Privat <jean@pryen.org>
Tue, 16 Dec 2014 19:10:32 +0000 (14:10 -0500)
committerJean Privat <jean@pryen.org>
Wed, 17 Dec 2014 04:43:30 +0000 (23:43 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/opts.nit

index 5a226b9..8c8f9ea 100644 (file)
@@ -143,7 +143,7 @@ abstract class OptionParameter
        redef fun read_param(it)
        do
                super
-               if it.is_ok and it.item.chars.first != '-' then
+               if it.is_ok and (it.item.is_empty or it.item.chars.first != '-') then
                        value = convert(it.item)
                        it.next
                else