nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/opt: add OptionCount
[nit.git]
/
lib
/
opts.nit
diff --git
a/lib/opts.nit
b/lib/opts.nit
index
81b9a98
..
b4da3f5
100644
(file)
--- a/
lib/opts.nit
+++ b/
lib/opts.nit
@@
-97,6
+97,15
@@
special Option
redef meth read_param(it) do value = true
end
redef meth read_param(it) do value = true
end
+class OptionCount
+special Option
+ redef type VALUE: Int
+
+ init(help: String, names: String...) do init_opt(help, 0, names)
+
+ redef meth read_param(it) do value += 1
+end
+
# Option with one mandatory parameter
class OptionParameter
special Option
# Option with one mandatory parameter
class OptionParameter
special Option