Skip to content

Commit 55b9146

Browse files
aweebitshadowspawn
andauthored
Improve shared subcommand error
Co-authored-by: John Gee <[email protected]>
1 parent 0553d32 commit 55b9146

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ class Command extends EventEmitter {
271271
- specify the name in Command constructor or using .name()`);
272272
}
273273
if (cmd.parent) {
274-
throw new Error(`'${cmd._name}' cannot be added using .addCommand()
275-
- it already has a parent command`);
274+
throw new Error(`Command '${cmd.name()}' passed to .addCommand() already has a parent
275+
- subcommands cannot be shared`);
276276
}
277277

278278
opts = opts || {};

0 commit comments

Comments
 (0)