fix(licenses): print help when no subcommand is specified (#5751)

close #5745
This commit is contained in:
Zoltan Kochan
2022-12-05 12:13:56 +02:00
committed by GitHub
parent c5aea50ae1
commit 568dc3ab21
2 changed files with 9 additions and 1 deletions

View File

@@ -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).

View File

@@ -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':