diff --git a/.changeset/rotten-mayflies-enjoy.md b/.changeset/rotten-mayflies-enjoy.md new file mode 100644 index 00000000000..905f9cce8e7 --- /dev/null +++ b/.changeset/rotten-mayflies-enjoy.md @@ -0,0 +1,6 @@ +--- +"@pnpm/plugin-commands-licenses": patch +"pnpm": patch +--- + +`pnpm licenses` should print help, not just an error message [#5745](https://github.com/pnpm/pnpm/issues/5745). diff --git a/reviewing/plugin-commands-licenses/src/licenses.ts b/reviewing/plugin-commands-licenses/src/licenses.ts index 443193f5ceb..ba2facb4536 100644 --- a/reviewing/plugin-commands-licenses/src/licenses.ts +++ b/reviewing/plugin-commands-licenses/src/licenses.ts @@ -85,7 +85,9 @@ export async function handler ( params: string[] = [] ) { if (params.length === 0) { - throw new PnpmError('LICENCES_NO_SUBCOMMAND', 'Please specify the subcommand') + throw new PnpmError('LICENCES_NO_SUBCOMMAND', 'Please specify the subcommand', { + hint: help(), + }) } switch (params[0]) { case 'list':