From 4700b095ec69ec00ab6841982af2ddf8c30a3293 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Fri, 23 Dec 2022 16:09:55 +0200 Subject: [PATCH] fix: pnpm env should print help --- .changeset/good-turtles-perform.md | 6 ++++++ env/plugin-commands-env/src/env.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/good-turtles-perform.md diff --git a/.changeset/good-turtles-perform.md b/.changeset/good-turtles-perform.md new file mode 100644 index 0000000000..9e6a1c50e3 --- /dev/null +++ b/.changeset/good-turtles-perform.md @@ -0,0 +1,6 @@ +--- +"@pnpm/plugin-commands-env": patch +"pnpm": patch +--- + +`pnpm env` should print help. diff --git a/env/plugin-commands-env/src/env.ts b/env/plugin-commands-env/src/env.ts index f2ddea9f0d..66283ff836 100644 --- a/env/plugin-commands-env/src/env.ts +++ b/env/plugin-commands-env/src/env.ts @@ -83,7 +83,9 @@ export function help () { export async function handler (opts: NvmNodeCommandOptions, params: string[]) { if (params.length === 0) { - throw new PnpmError('ENV_NO_SUBCOMMAND', 'Please specify the subcommand') + throw new PnpmError('ENV_NO_SUBCOMMAND', 'Please specify the subcommand', { + hint: help(), + }) } switch (params[0]) { case 'use': {