From 4c294c174b89c00d5442b21e020258a4128a45b1 Mon Sep 17 00:00:00 2001 From: abetomo Date: Mon, 3 Sep 2018 12:18:10 +0900 Subject: [PATCH] Fix to change default value to string fixes: https://github.com/tj/commander.js/issues/855 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8e296691c..53ec69854 100644 --- a/index.js +++ b/index.js @@ -1053,7 +1053,7 @@ Command.prototype.optionHelp = function() { // Append the help information return this.options.map(function(option) { return pad(option.flags, width) + ' ' + option.description + - ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : ''); + ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) .join('\n'); };