Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress param data type being output on --help #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ if (process.env.NODE_DISABLE_COLORS || process.env.TERM === 'dumb') {
* The 'help' plugin is enabled by default.
*/
var enable = {
help: true, //Adds -h, --help
version: false, //Adds -v,--version => gets version by parsing a nearby package.json
status: false, //Adds -k,--no-color & --debug => display plain status messages /display debug messages
timeout: false, //Adds -t,--timeout N => timeout the process after N seconds
catchall: false, //Adds -c,--catch => catch and output uncaughtExceptions
glob: false //Adds glob matching => use cli.glob(arg)
help: true, //Adds -h, --help
version: false, //Adds -v,--version => gets version by parsing a nearby package.json
status: false, //Adds -k,--no-color & --debug => display plain status messages /display debug messages
timeout: false, //Adds -t,--timeout N => timeout the process after N seconds
catchall: false, //Adds -c,--catch => catch and output uncaughtExceptions
glob: false, //Adds glob matching => use cli.glob(arg)
suppresshelptype: false //Adds the suppression of type display in --help output
}
cli.enable = function (/*plugins*/) {
Array.prototype.slice.call(arguments).forEach(function (plugin) {
Expand All @@ -105,6 +106,9 @@ cli.enable = function (/*plugins*/) {
case 'glob':
cli.glob = require('glob');
break;
case 'suppresshelptype':
cli.suppresshelptype = true;
break;
default:
cli.fatal('Unknown plugin "' + plugin + '"');
break;
Expand Down Expand Up @@ -617,7 +621,7 @@ cli.getUsage = function (code) {
}
line += ' ';

if (type) {
if (!cli.suppresshelptype && type) {
if (type instanceof Array) {
desc += '. VALUE must be either [' + type.join('|') + ']';
type = 'VALUE';
Expand Down