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:
Diffstat (limited to 'lib/utils/cmd-list.js')
-rw-r--r--lib/utils/cmd-list.js158
1 files changed, 80 insertions, 78 deletions
diff --git a/lib/utils/cmd-list.js b/lib/utils/cmd-list.js
index 1469ebdd6..c1d20186a 100644
--- a/lib/utils/cmd-list.js
+++ b/lib/utils/cmd-list.js
@@ -1,5 +1,23 @@
-// short names for common things
-const shorthands = {
+const abbrev = require('abbrev')
+
+// plumbing should not have any aliases
+const aliases = {
+
+ // aliases
+ login: 'adduser',
+ author: 'owner',
+ home: 'docs',
+ issues: 'bugs',
+ info: 'view',
+ show: 'view',
+ find: 'search',
+ add: 'install',
+ unlink: 'uninstall',
+ remove: 'uninstall',
+ rm: 'uninstall',
+ r: 'uninstall',
+
+ // short names for common things
un: 'uninstall',
rb: 'rebuild',
list: 'ls',
@@ -21,12 +39,11 @@ const shorthands = {
'clean-install-test': 'cit',
x: 'exec',
why: 'explain',
-}
-
-const affordances = {
la: 'll',
verison: 'version',
ic: 'ci',
+
+ // typos
innit: 'init',
// manually abbrev so that install-test doesn't make insta stop working
in: 'install',
@@ -44,105 +61,90 @@ const affordances = {
'dist-tags': 'dist-tag',
upgrade: 'update',
udpate: 'update',
- login: 'adduser',
- 'add-user': 'adduser',
- author: 'owner',
- home: 'docs',
- issues: 'bugs',
- info: 'view',
- show: 'view',
- find: 'search',
- add: 'install',
- unlink: 'uninstall',
- remove: 'uninstall',
- rm: 'uninstall',
- r: 'uninstall',
rum: 'run-script',
sit: 'cit',
urn: 'run-script',
ogr: 'org',
+ 'add-user': 'adduser',
}
// these are filenames in .
+// Keep these sorted so that lib/utils/npm-usage.js outputs in order
const cmdList = [
- 'ci',
- 'install-ci-test',
- 'install',
- 'install-test',
- 'uninstall',
+ 'access',
+ 'adduser',
+ 'audit',
+ 'bin',
+ 'bugs',
'cache',
+ 'ci',
+ 'completion',
'config',
- 'set',
- 'get',
- 'update',
- 'outdated',
- 'prune',
- 'pack',
- 'find-dupes',
'dedupe',
+ 'deprecate',
+ 'diff',
+ 'dist-tag',
+ 'docs',
+ 'doctor',
+ 'edit',
+ 'exec',
+ 'explain',
+ 'explore',
+ 'find-dupes',
+ 'fund',
+ 'get',
+ 'help',
'hook',
-
- 'rebuild',
+ 'init',
+ 'install',
+ 'install-ci-test',
+ 'install-test',
'link',
-
- 'publish',
- 'star',
- 'stars',
- 'unstar',
- 'adduser',
+ 'll',
'login', // This is an alias for `adduser` but it can be confusing
'logout',
- 'unpublish',
- 'owner',
- 'access',
- 'team',
- 'deprecate',
- 'shrinkwrap',
- 'token',
- 'profile',
- 'audit',
- 'fund',
- 'org',
-
- 'help',
'ls',
- 'll',
- 'search',
- 'view',
- 'init',
- 'version',
- 'edit',
- 'explore',
- 'docs',
- 'repo',
- 'bugs',
- 'root',
- 'prefix',
- 'bin',
- 'whoami',
- 'diff',
- 'dist-tag',
+ 'org',
+ 'outdated',
+ 'owner',
+ 'pack',
'ping',
'pkg',
-
- 'test',
- 'stop',
- 'start',
+ 'prefix',
+ 'profile',
+ 'prune',
+ 'publish',
+ 'rebuild',
+ 'repo',
'restart',
+ 'root',
'run-script',
+ 'search',
+ 'set',
'set-script',
- 'completion',
- 'doctor',
- 'exec',
- 'explain',
+ 'shrinkwrap',
+ 'star',
+ 'stars',
+ 'start',
+ 'stop',
+ 'team',
+ 'test',
+ 'token',
+ 'uninstall',
+ 'unpublish',
+ 'unstar',
+ 'update',
+ 'version',
+ 'view',
+ 'whoami',
]
const plumbing = ['birthday', 'help-search']
+const abbrevs = abbrev(cmdList.concat(Object.keys(aliases)))
module.exports = {
- aliases: Object.assign({}, shorthands, affordances),
- shorthands,
- affordances,
+ abbrevs,
+ aliases,
cmdList,
plumbing,
}