From 2ee5c21103ce588906f85a9ba5df3a4bacabb362 Mon Sep 17 00:00:00 2001 From: Maxime Leroy Date: Thu, 26 Jun 2014 15:14:07 -0400 Subject: [PATCH] opts: added possibility to hide an option from the usage (easter egg?) Signed-off-by: Maxime Leroy --- lib/opts.nit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 1.7.9.5