fix(smartcli): tighten command parsing and error handling while updating build and package configuration
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartcli',
|
||||
version: '4.0.19',
|
||||
version: '4.0.21',
|
||||
description: 'A library that simplifies building reactive command-line applications using observables, with robust support for commands, arguments, options, aliases, and asynchronous operation management.'
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export class Smartcli {
|
||||
*/
|
||||
public parseCompleted = plugins.smartpromise.defer<any>();
|
||||
|
||||
public version: string;
|
||||
public version?: string;
|
||||
|
||||
/**
|
||||
* map of all Trigger/Observable objects to keep track
|
||||
@@ -65,6 +65,9 @@ export class Smartcli {
|
||||
*/
|
||||
public triggerCommand(commandNameArg: string, argvObject: any) {
|
||||
const triggerSubject = this.getCommandSubject(commandNameArg);
|
||||
if (!triggerSubject) {
|
||||
throw new Error(`No smartcli command registered for ${commandNameArg}`);
|
||||
}
|
||||
triggerSubject.next(argvObject);
|
||||
return triggerSubject;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user