From 1674136bc14b0f708bb01f75d65474346c863bd9 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 30 Apr 2024 00:07:56 -0700 Subject: [PATCH] docs: correct search help output (#7441) `--long` does not do anything and hasn't in some time. The first search param is also required. Closes: https://github.com/npm/cli/issues/7402 Closes: https://github.com/npm/cli/issues/7434 --- lib/commands/search.js | 3 +-- tap-snapshots/test/lib/docs.js.test.cjs | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/commands/search.js b/lib/commands/search.js index 93005398480d1..8b6c01e3930d8 100644 --- a/lib/commands/search.js +++ b/lib/commands/search.js @@ -8,7 +8,6 @@ class Search extends BaseCommand { static description = 'Search for packages' static name = 'search' static params = [ - 'long', 'json', 'color', 'parseable', @@ -22,7 +21,7 @@ class Search extends BaseCommand { 'offline', ] - static usage = ['[search terms ...]'] + static usage = [' [ ...]'] async exec (args) { const opts = { diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index 671e614851074..85657b9e75dc4 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -4065,11 +4065,11 @@ exports[`test/lib/docs.js TAP usage search > must match snapshot 1`] = ` Search for packages Usage: -npm search [search terms ...] +npm search [ ...] Options: -[-l|--long] [--json] [--color|--no-color|--color always] [-p|--parseable] -[--no-description] [--searchlimit ] [--searchopts ] +[--json] [--color|--no-color|--color always] [-p|--parseable] [--no-description] +[--searchlimit ] [--searchopts ] [--searchexclude ] [--registry ] [--prefer-online] [--prefer-offline] [--offline] @@ -4078,14 +4078,13 @@ aliases: find, s, se Run "npm help search" for more info \`\`\`bash -npm search [search terms ...] +npm search [ ...] aliases: find, s, se \`\`\` Note: This command is unaware of workspaces. -#### \`long\` #### \`json\` #### \`color\` #### \`parseable\`