Skip to content

Commit

Permalink
fix(licenses): print help when no subcommand is specified
Browse files Browse the repository at this point in the history
close #5745
  • Loading branch information
zkochan committed Dec 5, 2022
1 parent bcf2d54 commit ae87f4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .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).
4 changes: 3 additions & 1 deletion reviewing/plugin-commands-licenses/src/licenses.ts
Expand Up @@ -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':
Expand Down

0 comments on commit ae87f4b

Please sign in to comment.