nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
opts: added possibility to hide an option from the usage (easter egg?)
[nit.git]
/
lib
/
opts.nit
diff --git
a/lib/opts.nit
b/lib/opts.nit
index
97a2a1f
..
20bf42f
100644
(file)
--- a/
lib/opts.nit
+++ b/
lib/opts.nit
@@
-31,6
+31,9
@@
abstract class Option
# Is this option mandatory?
var mandatory: Bool writable = false
# Is this option mandatory?
var mandatory: Bool writable = false
+ # Is this option hidden from `usage`?
+ var hidden: Bool writable = false
+
# Has this option been read?
var read: Bool writable = false
# Has this option been read?
var read: Bool writable = false
@@
-276,9
+279,11
@@
class OptionContext
end
if lmax < l then lmax = l
end
end
if lmax < l then lmax = l
end
-
+
for i in options do
for i in options do
- print(i.pretty(lmax))
+ if not i.hidden then
+ print(i.pretty(lmax))
+ end
end
end
end
end