You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,12 +48,13 @@ What this piece of code does is the following:
48
48
* it creates a help message and help options, with the banner above the options
49
49
* it creates a version option, which displays the given text
50
50
* it creates a long accessor for each option, according to the symbol - for example `"--verbose"` for `:verbose`
51
-
* it crease a short accessor, which is the first character of the long accessor (automatically resolves duplicates)
51
+
* it creates a short accessor, which is the first character of the long accessor (automatically resolves duplication)
52
+
* it converts under_score options in Ruby to hypenated-options for the CLI, e.g. `:plus_selection` becomes `--plus-selection`
52
53
* it checks if the class of the input and the default value match
53
-
* it creates a switch, if no default value exist or the default value is `true` or `false`
54
-
* when value\_in\_set is given, it validates if the input value is in the given array
55
-
* when value_matches is given, it validates if the input value matches the regular expression
56
-
* when value_satisfies is given, it validates if the lamda or Proc evaluates to `true`, when fed with the input value
54
+
* it creates a switch if no default value exist or the default value is `true` or `false`
55
+
* when `value_in_set` is given, it validates if the input value is in the given array
56
+
* when `value_matches` is given, it validates if the input value matches the regular expression
57
+
* when `value_satisfies` is given, it validates if the lambda or Proc evaluates to `true` when fed with the input value
57
58
* it stores all parsed arguments and default values in the options hash, i.e. to access the value of `:mutation` in your script, write `options[:mutation]`
58
59
59
60
The automatically generated help message looks like this:
0 commit comments