fix linting issues
This commit is contained in:
parent
ce121b8b7f
commit
45d3ce8ffc
@ -44,7 +44,7 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* adds an alias, meaning one equals the other in terms of command execution.
|
* adds an alias, meaning one equals the other in terms of command execution.
|
||||||
*/
|
*/
|
||||||
addCommandAlias(keyArg, aliasArg): void {
|
addCommandAlias (keyArg, aliasArg): void {
|
||||||
this.argv = this.argv.alias(keyArg, aliasArg)
|
this.argv = this.argv.alias(keyArg, aliasArg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ export class Smartcli {
|
|||||||
* adds a Command by returning a Promise that reacts to the specific commandString given.
|
* adds a Command by returning a Promise that reacts to the specific commandString given.
|
||||||
* Note: in e.g. "npm install something" the "install" is considered the command.
|
* Note: in e.g. "npm install something" the "install" is considered the command.
|
||||||
*/
|
*/
|
||||||
addCommand(commandNameArg: string): Promise<any> {
|
addCommand (commandNameArg: string): Promise<any> {
|
||||||
let done = smartq.defer<any>()
|
let done = smartq.defer<any>()
|
||||||
this.allCommandPromisesMap.add({
|
this.allCommandPromisesMap.add({
|
||||||
commandName: commandNameArg,
|
commandName: commandNameArg,
|
||||||
@ -71,16 +71,16 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* gets a Promise for a command word
|
* gets a Promise for a command word
|
||||||
*/
|
*/
|
||||||
getCommandPromiseByName(commandNameArg: string): Promise<void> {
|
getCommandPromiseByName (commandNameArg: string): Promise<void> {
|
||||||
return this.allCommandPromisesMap.find(commandDeferredObjectArg => {
|
return this.allCommandPromisesMap.find(commandDeferredObjectArg => {
|
||||||
return commandDeferredObjectArg.commandName === commandNameArg
|
return commandDeferredObjectArg.commandName === commandNameArg
|
||||||
}).promise
|
}).promise
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* adds a Trigger. Like addCommand(), but returns an subscribable observable
|
* adds a Trigger. Like addCommand(), but returns an subscribable observable
|
||||||
*/
|
*/
|
||||||
addTrigger(triggerNameArg: string) {
|
addTrigger (triggerNameArg: string) {
|
||||||
let triggerSubject = new Subject<any>()
|
let triggerSubject = new Subject<any>()
|
||||||
this.allTriggerObservablesMap.add({
|
this.allTriggerObservablesMap.add({
|
||||||
triggerName: triggerNameArg,
|
triggerName: triggerNameArg,
|
||||||
@ -96,7 +96,7 @@ export class Smartcli {
|
|||||||
* execute trigger by name
|
* execute trigger by name
|
||||||
* @param commandNameArg - the name of the command to trigger
|
* @param commandNameArg - the name of the command to trigger
|
||||||
*/
|
*/
|
||||||
trigger(triggerName: string) {
|
trigger (triggerName: string) {
|
||||||
let triggerSubject = this.allTriggerObservablesMap.find(triggerObservableObjectArg => {
|
let triggerSubject = this.allTriggerObservablesMap.find(triggerObservableObjectArg => {
|
||||||
return triggerObservableObjectArg.triggerName === triggerName
|
return triggerObservableObjectArg.triggerName === triggerName
|
||||||
}).subject
|
}).subject
|
||||||
@ -107,7 +107,7 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* allows to specify help text to be printed above the rest of the help text
|
* allows to specify help text to be printed above the rest of the help text
|
||||||
*/
|
*/
|
||||||
addHelp(optionsArg: {
|
addHelp (optionsArg: {
|
||||||
helpText: string
|
helpText: string
|
||||||
}) {
|
}) {
|
||||||
this.addCommand('help').then(argvArg => {
|
this.addCommand('help').then(argvArg => {
|
||||||
@ -118,7 +118,7 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* specify version to be printed for -v --version
|
* specify version to be printed for -v --version
|
||||||
*/
|
*/
|
||||||
addVersion(versionArg: string) {
|
addVersion (versionArg: string) {
|
||||||
this.version = versionArg
|
this.version = versionArg
|
||||||
this.addCommandAlias('v', 'version')
|
this.addCommandAlias('v', 'version')
|
||||||
this.parseStarted.promise
|
this.parseStarted.promise
|
||||||
@ -132,7 +132,7 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* returns promise that is resolved when no commands are specified
|
* returns promise that is resolved when no commands are specified
|
||||||
*/
|
*/
|
||||||
standardTask(): Promise<any> {
|
standardTask (): Promise<any> {
|
||||||
let done = smartq.defer<any>()
|
let done = smartq.defer<any>()
|
||||||
this.allCommandPromisesMap.add({
|
this.allCommandPromisesMap.add({
|
||||||
commandName: 'standard',
|
commandName: 'standard',
|
||||||
@ -150,7 +150,7 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* start the process of evaluating commands
|
* start the process of evaluating commands
|
||||||
*/
|
*/
|
||||||
startParse(): void {
|
startParse (): void {
|
||||||
this.argv = this.argv.argv
|
this.argv = this.argv.argv
|
||||||
this.parseStarted.resolve()
|
this.parseStarted.resolve()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user