From: Maxime Leroy Date: Thu, 26 Jun 2014 19:14:07 +0000 (-0400) Subject: opts: added possibility to hide an option from the usage (easter egg?) X-Git-Tag: v0.6.7~22^2~2 X-Git-Url: http://nitlanguage.org opts: added possibility to hide an option from the usage (easter egg?) Signed-off-by: Maxime Leroy --- diff --git a/lib/opts.nit b/lib/opts.nit index 97a2a1f..20bf42f 100644 --- 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 hidden from `usage`? + var hidden: 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 - + for i in options do - print(i.pretty(lmax)) + if not i.hidden then + print(i.pretty(lmax)) + end end end