From 53f22b68ad54e1240631076967c6ebbdbdf17c19 Mon Sep 17 00:00:00 2001 From: Mizunashi Mana Date: Sat, 21 May 2016 05:37:27 +0900 Subject: [PATCH] add special boolean option support --- lib/commands.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/commands.js b/lib/commands.js index 6e394a9..f1523e2 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -29,7 +29,10 @@ function help(commands) { if (after.length > 0) after = "("+after.join("; ")+")"; else after = ""; - indent_output(2, '--' + option.name, option.description + ' ' + after); + var optname = '--'; + if (typeof option.defaults === 'boolean') optname += '[no-]'; + optname += option.name; + indent_output(2, optname, option.description + ' ' + after); }); console.log(''); });