Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct command line usage messages #214

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/cli/npm-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ npm-access(1) -- Set access level on published packages
npm access public [<package>]
npm access restricted [<package>]

npm access grant <read-only|read-write> <scope:team> [<package>]
npm access grant read-only|read-write <scope:team> [<package>]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not? without the angle brackets it might be confused for being pipes.

Copy link
Author

@Low-power Low-power Jul 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, | should never mean pipe in SYNOPSIS section of manuals or on-line usage message.

Could I understand the < character as the read-open-redirect operator in UNIX shell?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However this change could make the 'or' items be misleading, so please also consider followings:

npm access grant {read-only|read-write} <scope:team> [<package>]
or
npm access grant (read-only|read-write) <scope:team> [<package>]

npm access revoke <scope:team> [<package>]

npm access 2fa-required [<package>]
Expand Down
2 changes: 1 addition & 1 deletion doc/cli/npm-adduser.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<url>] [--scope=@<orgname>] [--always-auth] [--auth-type=legacy]

aliases: login, add-user

Expand Down
2 changes: 1 addition & 1 deletion doc/cli/npm-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ npm-hook(1) -- Manage registry hooks

npm hook ls [pkg]
npm hook add <entity> <url> <secret>
npm hook update <id> <url> [secret]
npm hook update <id> <url> [<secret>]
npm hook rm <id>

## EXAMPLE
Expand Down
4 changes: 2 additions & 2 deletions doc/cli/npm-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ npm-publish(1) -- Publish a package

## SYNOPSIS

npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]
npm publish [<tarball>|<folder>] [--tag <tag>] [--access public|restricted] [--otp otpcode] [--dry-run]

Publishes '.' if no argument supplied
Sets tag 'latest' if no --tag specified
Expand Down Expand Up @@ -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 <public|restricted>]`
* `[--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`
Expand Down
2 changes: 1 addition & 1 deletion doc/cli/npm-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] [<search terms> ...]

aliases: s, se, find

Expand Down
2 changes: 1 addition & 1 deletion doc/cli/npm-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <id|token>
npm token revoke <id>|<token>

## DESCRIPTION

Expand Down
2 changes: 1 addition & 1 deletion lib/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ access.usage = usage(
'npm access',
'npm access public [<package>]\n' +
'npm access restricted [<package>]\n' +
'npm access grant <read-only|read-write> <scope:team> [<package>]\n' +
'npm access grant read-only|read-write <scope:team> [<package>]\n' +
'npm access revoke <scope:team> [<package>]\n' +
'npm access 2fa-required [<package>]\n' +
'npm access 2fa-not-required [<package>]\n' +
Expand Down
2 changes: 1 addition & 1 deletion lib/adduser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ try {

adduser.usage = usage(
'adduser',
'npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] [--always-auth]'
'npm adduser [--registry=<url>] [--scope=@<orgname>] [--auth-type=legacy] [--always-auth]'
)

function adduser (args, cb) {
Expand Down
2 changes: 1 addition & 1 deletion lib/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const validate = require('aproba')

hook.usage = [
'npm hook add <pkg> <url> <secret> [--type=<type>]',
'npm hook ls [pkg]',
'npm hook ls [<pkg>]',
'npm hook rm <id>',
'npm hook update <id> <url> <secret>'
].join('\n')
Expand Down
2 changes: 1 addition & 1 deletion lib/install-ci-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var usage = require('./utils/usage')

installTest.usage = usage(
'install-ci-test',
'\nnpm install-ci-test [args]' +
'\nnpm install-ci-test [<args>]' +
'\nSame args as `npm ci`'
)

Expand Down
2 changes: 1 addition & 1 deletion lib/install-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var usage = require('./utils/usage')

installTest.usage = usage(
'install-test',
'\nnpm install-test [args]' +
'\nnpm install-test [<args>]' +
'\nSame args as `npm install`'
)

Expand Down
6 changes: 3 additions & 3 deletions lib/org.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [<username>]'
'npm org set <orgname> <username> [developer | admin | owner]\n' +
'npm org rm <orgname> <username>\n' +
'npm org ls <orgname> [<username>]'

const OrgConfig = figgyPudding({
json: {},
Expand Down
2 changes: 1 addition & 1 deletion lib/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const PingConfig = figgyPudding({

module.exports = ping

ping.usage = 'npm ping\nping registry'
ping.usage = 'npm ping\nping --registry <registry>'

function ping (args, silent, cb) {
if (typeof cb !== 'function') {
Expand Down
2 changes: 1 addition & 1 deletion lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--dry-run]' +
publish.usage = 'npm publish [<tarball>|<folder>] [--tag <tag>] [--access public|restricted] [--dry-run]' +
"\n\nPublishes '.' if no argument supplied" +
'\n\nSets tag `latest` if no --tag specified'

Expand Down
2 changes: 1 addition & 1 deletion lib/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const usage = require('./utils/usage')

search.usage = usage(
'search',
'npm search [--long] [search terms ...]'
'npm search [--long] [<search terms> ...]'
)

search.completion = function (opts, cb) {
Expand Down
2 changes: 1 addition & 1 deletion lib/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ token._validateCIDRList = validateCIDRList
token.usage =
'npm token list\n' +
'npm token revoke <tokenKey>\n' +
'npm token create [--read-only] [--cidr=list]\n'
'npm token create [--read-only] [--cidr=<list>]\n'

token.subcommands = ['list', 'revoke', 'create']

Expand Down
2 changes: 1 addition & 1 deletion lib/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ViewConfig = figgyPudding({

view.usage = usage(
'view',
'npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]'
'npm view [<@scope>/]<pkg>[@<version>] [<field>[.<subfield>]...]'
)

view.completion = function (opts, cb) {
Expand Down