Skip to content

Commit

Permalink
Improve abbrevs for install and help
Browse files Browse the repository at this point in the history
The existence of 'install-test' and 'install-clean' make 'npm inst' no longer
de-reference to 'npm install'.  Similarly, the existence of 'help-search'
prevents 'hel' from being a shorthand for 'help'.

This adds some artisanally hand-crafted abbreviations for these cases.

Fix: #1617
  • Loading branch information
isaacs committed Aug 5, 2020
1 parent 0d9b127 commit c9e877f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
15 changes: 11 additions & 4 deletions lib/config/cmd-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ const affordances = {
verison: 'version',
ic: 'ci',
innit: 'init',
isntall: 'install',
// manually abbrev so that install-test doesn't make insta stop working
in: 'install',
ins: 'install',
inst: 'install',
insta: 'install',
instal: 'install',
isnt: 'install',
isnta: 'install',
isntal: 'install',
'install-clean': 'ci',
'isntall-clean': 'ci',
hlep: 'help',
'dist-tags': 'dist-tag',
apihelp: 'help',
upgrade: 'update',
udpate: 'update',
login: 'adduser',
Expand Down Expand Up @@ -95,7 +103,6 @@ const cmdList = [
'org',

'help',
'help-search',
'ls',
'll',
'search',
Expand Down Expand Up @@ -124,7 +131,7 @@ const cmdList = [
'exec'
]

const plumbing = ['birthday']
const plumbing = ['birthday', 'help-search']
module.exports = {
aliases: Object.assign({}, shorthands, affordances),
shorthands,
Expand Down
24 changes: 19 additions & 5 deletions tap-snapshots/test-lib-config-cmd-list.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,23 @@ Object {
"affordances": Object {
"add": "install",
"add-user": "adduser",
"apihelp": "help",
"author": "owner",
"dist-tags": "dist-tag",
"find": "search",
"hlep": "help",
"home": "docs",
"ic": "ci",
"in": "install",
"info": "view",
"innit": "init",
"ins": "install",
"inst": "install",
"insta": "install",
"instal": "install",
"install-clean": "ci",
"isntall": "install",
"isnt": "install",
"isnta": "install",
"isntal": "install",
"isntall-clean": "ci",
"issues": "bugs",
"la": "ll",
Expand All @@ -40,7 +47,6 @@ Object {
"aliases": Object {
"add": "install",
"add-user": "adduser",
"apihelp": "help",
"author": "owner",
"c": "config",
"cit": "install-ci-test",
Expand All @@ -50,13 +56,21 @@ Object {
"ddp": "dedupe",
"dist-tags": "dist-tag",
"find": "search",
"hlep": "help",
"home": "docs",
"i": "install",
"ic": "ci",
"in": "install",
"info": "view",
"innit": "init",
"ins": "install",
"inst": "install",
"insta": "install",
"instal": "install",
"install-clean": "ci",
"isntall": "install",
"isnt": "install",
"isnta": "install",
"isntal": "install",
"isntall-clean": "ci",
"issues": "bugs",
"it": "install-test",
Expand Down Expand Up @@ -125,7 +139,6 @@ Object {
"fund",
"org",
"help",
"help-search",
"ls",
"ll",
"search",
Expand Down Expand Up @@ -154,6 +167,7 @@ Object {
],
"plumbing": Array [
"birthday",
"help-search",
],
"shorthands": Object {
"c": "config",
Expand Down

0 comments on commit c9e877f

Please sign in to comment.