From 6fecef4cc13be10d426ca7c3d4f14fbb09fb983c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Lev=C3=BD?= Date: Fri, 19 Feb 2021 23:09:04 +0100 Subject: [PATCH] feat(why): implement shorthands for "--dev" & "--prod" options (#3158) close #3153 --- .changeset/giant-tigers-smoke.md | 5 +++++ packages/plugin-commands-listing/src/why.ts | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/giant-tigers-smoke.md diff --git a/.changeset/giant-tigers-smoke.md b/.changeset/giant-tigers-smoke.md new file mode 100644 index 0000000000..d5b57937a5 --- /dev/null +++ b/.changeset/giant-tigers-smoke.md @@ -0,0 +1,5 @@ +--- +"@pnpm/plugin-commands-listing": patch +--- + +Implement shorthands for "--dev" & "--prod" options of `why` command diff --git a/packages/plugin-commands-listing/src/why.ts b/packages/plugin-commands-listing/src/why.ts index 95233b9b24..88b902de55 100644 --- a/packages/plugin-commands-listing/src/why.ts +++ b/packages/plugin-commands-listing/src/why.ts @@ -25,6 +25,11 @@ export const cliOptionsTypes = () => ({ recursive: Boolean, }) +export const shorthands = { + D: '--dev', + P: '--production', +} + export const commandNames = ['why'] export function help () { @@ -63,10 +68,12 @@ For options that may be used with `-r`, see "pnpm help recursive"', { description: 'Display only the dependency graph for packages in `dependencies` and `optionalDependencies`', name: '--prod', + shortAlias: '-P', }, { description: 'Display only the dependency graph for packages in `devDependencies`', name: '--dev', + shortAlias: '-D', }, { description: "Don't display packages from `optionalDependencies`",