Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/content/using-npm/config.md2
-rw-r--r--lib/utils/config/definition.js9
-rw-r--r--tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js12
3 files changed, 12 insertions, 11 deletions
diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md
index b0f365f29..b2e8baf01 100644
--- a/docs/content/using-npm/config.md
+++ b/docs/content/using-npm/config.md
@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`
* Default: null
-* Type: "info", "low", "moderate", "high", "critical", "none", or null
+* Type: null, "info", "low", "moderate", "high", "critical", or "none"
The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
diff --git a/lib/utils/config/definition.js b/lib/utils/config/definition.js
index e7c605fb7..5ec2ba1ab 100644
--- a/lib/utils/config/definition.js
+++ b/lib/utils/config/definition.js
@@ -116,13 +116,14 @@ const describeUsage = (def) => {
description = def.hint
}
- if (multiple)
- description = `${description} [${description} ...]`
-
if (bool)
key = `${key}|${key}`
- return `${key} ${description}`
+ const usage = `${key} ${description}`
+ if (multiple)
+ return `${usage} [${usage} ...]`
+ else
+ return usage
}
const describeType = type => {
diff --git a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
index 152f1f7c7..a0b8d1999 100644
--- a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
+++ b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
@@ -335,7 +335,7 @@ All commands:
npm docs [<pkgname> [<pkgname> ...]]
Options:
- [--browser|--browser <browser>] [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
+ [--browser|--browser <browser>] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
alias: home
@@ -370,7 +370,7 @@ All commands:
npm exec --package=foo -c '<cmd> [args...]'
Options:
- [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
+ [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
alias: x
@@ -702,7 +702,7 @@ All commands:
npm repo [<pkgname> [<pkgname> ...]]
Options:
- [--browser|--browser <browser>] [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
+ [--browser|--browser <browser>] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
Run "npm help repo" for more info
@@ -735,7 +735,7 @@ All commands:
npm run-script <command> [-- <args>]
Options:
- [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
+ [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
aliases: run, rum, urn
@@ -772,7 +772,7 @@ All commands:
npm set-script [<script>] [<command>]
Options:
- [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
+ [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
Run "npm help set-script" for more info
@@ -921,7 +921,7 @@ All commands:
npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]
Options:
- [--json] [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
+ [--json] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
aliases: v, info, show