lib/opts: improve doc of `OptionEnum`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 19 Jul 2015 19:51:59 +0000 (15:51 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 20 Jul 2015 17:42:35 +0000 (13:42 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/opts.nit

index fa5ce15..1d8a264 100644 (file)
@@ -163,7 +163,7 @@ abstract class OptionParameter
        end
 end
 
-# An option with a String as parameter
+# An option with a `String` as parameter
 class OptionString
        super OptionParameter
        redef type VALUE: nullable String
@@ -174,9 +174,10 @@ class OptionString
        redef fun convert(str) do return str
 end
 
-# An option with an enum as parameter
-# In the code, declaring an option enum (-e) with an enum like `["zero", "one", "two"]
-# In the command line, typing `myprog -e one` is giving 1 as value
+# An option to choose from an enumeration
+#
+# Declare an enumeration option with all its possible values as an array.
+# Once the arguments are processed, `value` is set as the index of the selected value, if any.
 class OptionEnum
        super OptionParameter
        redef type VALUE: Int