Skip to content

Commit

Permalink
docs: correct search help output (#7441)
Browse files Browse the repository at this point in the history
`--long` does not do anything and hasn't in some time.
The first search param is also required.

Closes: #7402
Closes: #7434
  • Loading branch information
wraithgar committed Apr 30, 2024
1 parent bcc781a commit 1674136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/commands/search.js
Expand Up @@ -8,7 +8,6 @@ class Search extends BaseCommand {
static description = 'Search for packages'
static name = 'search'
static params = [
'long',
'json',
'color',
'parseable',
Expand All @@ -22,7 +21,7 @@ class Search extends BaseCommand {
'offline',
]

static usage = ['[search terms ...]']
static usage = ['<search term> [<search term> ...]']

async exec (args) {
const opts = {
Expand Down
9 changes: 4 additions & 5 deletions tap-snapshots/test/lib/docs.js.test.cjs
Expand Up @@ -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 <search term> [<search term> ...]
Options:
[-l|--long] [--json] [--color|--no-color|--color always] [-p|--parseable]
[--no-description] [--searchlimit <number>] [--searchopts <searchopts>]
[--json] [--color|--no-color|--color always] [-p|--parseable] [--no-description]
[--searchlimit <number>] [--searchopts <searchopts>]
[--searchexclude <searchexclude>] [--registry <registry>] [--prefer-online]
[--prefer-offline] [--offline]
Expand All @@ -4078,14 +4078,13 @@ aliases: find, s, se
Run "npm help search" for more info
\`\`\`bash
npm search [search terms ...]
npm search <search term> [<search term> ...]
aliases: find, s, se
\`\`\`
Note: This command is unaware of workspaces.
#### \`long\`
#### \`json\`
#### \`color\`
#### \`parseable\`
Expand Down

0 comments on commit 1674136

Please sign in to comment.