diff --git a/index.js b/index.js index f43061f..782eaae 100644 --- a/index.js +++ b/index.js @@ -41,10 +41,6 @@ module.exports = (opts, minimistOpts) => { minimistOpts.string.splice(index, 1); } - if (Array.isArray(opts.help)) { - opts.help = opts.help.join('\n'); - } - const pkg = typeof opts.pkg === 'string' ? require(path.join(parentDir, opts.pkg)) : opts.pkg; const argv = minimist(opts.argv, minimistOpts); let help = redent(trimNewlines((opts.help || '').replace(/\t+\n*$/, '')), 2); diff --git a/readme.md b/readme.md index d45c4c7..d150938 100644 --- a/readme.md +++ b/readme.md @@ -96,9 +96,6 @@ The help text you want shown. The input is reindented and starting/ending newlines are trimmed which means you can use a [template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings) without having to care about using the correct amount of indent. -If it's an array each item will be a line.
-*(Still supported, but you should use a template literal instead.)* - The description will be shown above your help text automatically. Set it to `false` to disable it altogether. diff --git a/test.js b/test.js index 2dbc0d4..650cd8f 100644 --- a/test.js +++ b/test.js @@ -9,10 +9,10 @@ global.Promise = Promise; test('return object', t => { const cli = m({ argv: ['foo', '--foo-bar', '-u', 'cat', '--', 'unicorn', 'cake'], - help: [ - 'Usage', - ' foo ' - ] + help: ` + Usage + foo + ` }, { 'alias': {u: 'unicorn'}, 'default': {meow: 'dog'}, @@ -29,7 +29,10 @@ test('return object', t => { }); test('support help shortcut', t => { - const cli = m(['unicorn', 'cat']); + const cli = m(` + unicorn + cat + `); t.is(cli.help, indentString('\nCLI app helper\n\nunicorn\ncat\n', 2)); });