From e87ebde01c2a5c34f018c7e7ccee5fc35edf42b6 Mon Sep 17 00:00:00 2001 From: WHR Date: Tue, 16 Jul 2019 11:51:35 +0800 Subject: [PATCH] Correct usage messages --- doc/cli/npm-access.md | 2 +- doc/cli/npm-adduser.md | 2 +- doc/cli/npm-hook.md | 2 +- doc/cli/npm-publish.md | 4 ++-- doc/cli/npm-search.md | 2 +- doc/cli/npm-token.md | 2 +- lib/access.js | 2 +- lib/adduser.js | 2 +- lib/hook.js | 2 +- lib/install-ci-test.js | 2 +- lib/install-test.js | 2 +- lib/org.js | 6 +++--- lib/ping.js | 2 +- lib/publish.js | 2 +- lib/search.js | 2 +- lib/token.js | 2 +- lib/view.js | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/cli/npm-access.md b/doc/cli/npm-access.md index aeea0178ec66d..f45918f8d9cb6 100644 --- a/doc/cli/npm-access.md +++ b/doc/cli/npm-access.md @@ -6,7 +6,7 @@ npm-access(1) -- Set access level on published packages npm access public [] npm access restricted [] - npm access grant [] + npm access grant read-only|read-write [] npm access revoke [] npm access 2fa-required [] diff --git a/doc/cli/npm-adduser.md b/doc/cli/npm-adduser.md index 72433e00f7483..13420bd3096e7 100644 --- a/doc/cli/npm-adduser.md +++ b/doc/cli/npm-adduser.md @@ -3,7 +3,7 @@ npm-adduser(1) -- Add a registry user account ## SYNOPSIS - npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy] + npm adduser [--registry=] [--scope=@] [--always-auth] [--auth-type=legacy] aliases: login, add-user diff --git a/doc/cli/npm-hook.md b/doc/cli/npm-hook.md index 519287242574a..10604f6a91d59 100644 --- a/doc/cli/npm-hook.md +++ b/doc/cli/npm-hook.md @@ -5,7 +5,7 @@ npm-hook(1) -- Manage registry hooks npm hook ls [pkg] npm hook add - npm hook update [secret] + npm hook update [] npm hook rm ## EXAMPLE diff --git a/doc/cli/npm-publish.md b/doc/cli/npm-publish.md index c582ad8470c2a..0175a32965603 100644 --- a/doc/cli/npm-publish.md +++ b/doc/cli/npm-publish.md @@ -4,7 +4,7 @@ npm-publish(1) -- Publish a package ## SYNOPSIS - npm publish [|] [--tag ] [--access ] [--otp otpcode] [--dry-run] + npm publish [|] [--tag ] [--access public|restricted] [--otp otpcode] [--dry-run] Publishes '.' if no argument supplied Sets tag 'latest' if no --tag specified @@ -35,7 +35,7 @@ specifying a different default registry or using a `npm-scope(7)` in the name and `npm install` installs the `latest` tag. See `npm-dist-tag(1)` for details about tags. -* `[--access ]` +* `[--access public|restricted]` Tells the registry whether this package should be published as public or restricted. Only applies to scoped packages, which default to `restricted`. If you don't have a paid account, you must publish with `--access public` diff --git a/doc/cli/npm-search.md b/doc/cli/npm-search.md index c1107d79b735b..cb2f2e51f13ba 100644 --- a/doc/cli/npm-search.md +++ b/doc/cli/npm-search.md @@ -3,7 +3,7 @@ npm-search(1) -- Search for packages ## SYNOPSIS - npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...] + npm search [-l|--long] [--json] [--parseable] [--no-description] [ ...] aliases: s, se, find diff --git a/doc/cli/npm-token.md b/doc/cli/npm-token.md index ae7aacae60155..226f1c85f04a6 100644 --- a/doc/cli/npm-token.md +++ b/doc/cli/npm-token.md @@ -5,7 +5,7 @@ npm-token(1) -- Manage your authentication tokens npm token list [--json|--parseable] npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16] - npm token revoke + npm token revoke | ## DESCRIPTION diff --git a/lib/access.js b/lib/access.js index 6657f4b0717a1..93adab558d710 100644 --- a/lib/access.js +++ b/lib/access.js @@ -20,7 +20,7 @@ access.usage = usage( 'npm access', 'npm access public []\n' + 'npm access restricted []\n' + - 'npm access grant []\n' + + 'npm access grant read-only|read-write []\n' + 'npm access revoke []\n' + 'npm access 2fa-required []\n' + 'npm access 2fa-not-required []\n' + diff --git a/lib/adduser.js b/lib/adduser.js index cf82ff5b04915..925322d66ee13 100644 --- a/lib/adduser.js +++ b/lib/adduser.js @@ -11,7 +11,7 @@ try { adduser.usage = usage( 'adduser', - 'npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] [--always-auth]' + 'npm adduser [--registry=] [--scope=@] [--auth-type=legacy] [--always-auth]' ) function adduser (args, cb) { diff --git a/lib/hook.js b/lib/hook.js index 54aea9f1e9d20..0c0a0a938378f 100644 --- a/lib/hook.js +++ b/lib/hook.js @@ -13,7 +13,7 @@ const validate = require('aproba') hook.usage = [ 'npm hook add [--type=]', - 'npm hook ls [pkg]', + 'npm hook ls []', 'npm hook rm ', 'npm hook update ' ].join('\n') diff --git a/lib/install-ci-test.js b/lib/install-ci-test.js index 26120f4a216df..958dc6c6c59d4 100644 --- a/lib/install-ci-test.js +++ b/lib/install-ci-test.js @@ -10,7 +10,7 @@ var usage = require('./utils/usage') installTest.usage = usage( 'install-ci-test', - '\nnpm install-ci-test [args]' + + '\nnpm install-ci-test []' + '\nSame args as `npm ci`' ) diff --git a/lib/install-test.js b/lib/install-test.js index f66dfd40152a0..93052b646bf94 100644 --- a/lib/install-test.js +++ b/lib/install-test.js @@ -10,7 +10,7 @@ var usage = require('./utils/usage') installTest.usage = usage( 'install-test', - '\nnpm install-test [args]' + + '\nnpm install-test []' + '\nSame args as `npm install`' ) diff --git a/lib/org.js b/lib/org.js index d8f857e3dfdd9..b9b533c37df84 100644 --- a/lib/org.js +++ b/lib/org.js @@ -12,9 +12,9 @@ module.exports = org org.subcommands = ['set', 'rm', 'ls'] org.usage = - 'npm org set orgname username [developer | admin | owner]\n' + - 'npm org rm orgname username\n' + - 'npm org ls orgname []' + 'npm org set [developer | admin | owner]\n' + + 'npm org rm \n' + + 'npm org ls []' const OrgConfig = figgyPudding({ json: {}, diff --git a/lib/ping.js b/lib/ping.js index 3023bab00e994..a36de2061e7de 100644 --- a/lib/ping.js +++ b/lib/ping.js @@ -14,7 +14,7 @@ const PingConfig = figgyPudding({ module.exports = ping -ping.usage = 'npm ping\nping registry' +ping.usage = 'npm ping\nping --registry ' function ping (args, silent, cb) { if (typeof cb !== 'function') { diff --git a/lib/publish.js b/lib/publish.js index e81fc1a057454..aac329bc1a94c 100644 --- a/lib/publish.js +++ b/lib/publish.js @@ -20,7 +20,7 @@ const readJson = BB.promisify(require('read-package-json')) const semver = require('semver') const statAsync = BB.promisify(require('graceful-fs').stat) -publish.usage = 'npm publish [|] [--tag ] [--access ] [--dry-run]' + +publish.usage = 'npm publish [|] [--tag ] [--access public|restricted] [--dry-run]' + "\n\nPublishes '.' if no argument supplied" + '\n\nSets tag `latest` if no --tag specified' diff --git a/lib/search.js b/lib/search.js index 3c59f8b43d15b..7f2c1c8322755 100644 --- a/lib/search.js +++ b/lib/search.js @@ -15,7 +15,7 @@ const usage = require('./utils/usage') search.usage = usage( 'search', - 'npm search [--long] [search terms ...]' + 'npm search [--long] [ ...]' ) search.completion = function (opts, cb) { diff --git a/lib/token.js b/lib/token.js index 9b1fbef9cecf4..543ad5916f9b2 100644 --- a/lib/token.js +++ b/lib/token.js @@ -22,7 +22,7 @@ token._validateCIDRList = validateCIDRList token.usage = 'npm token list\n' + 'npm token revoke \n' + - 'npm token create [--read-only] [--cidr=list]\n' + 'npm token create [--read-only] [--cidr=]\n' token.subcommands = ['list', 'revoke', 'create'] diff --git a/lib/view.js b/lib/view.js index a16884e25f647..3a9518c27b318 100644 --- a/lib/view.js +++ b/lib/view.js @@ -32,7 +32,7 @@ const ViewConfig = figgyPudding({ view.usage = usage( 'view', - 'npm view [<@scope>/][@] [[.subfield]...]' + 'npm view [<@scope>/][@] [[.]...]' ) view.completion = function (opts, cb) {