12 |
this.commandName = ""; |
this.commandName = ""; |
13 |
this.argv = []; |
this.argv = []; |
14 |
this.args = []; |
this.args = []; |
15 |
|
this.options = []; |
16 |
|
this.normalArgs = []; |
17 |
this.loadCommands(); |
this.loadCommands(); |
18 |
this.snippetManager = new SnippetManager(); |
this.snippetManager = new SnippetManager(); |
19 |
} |
} |
68 |
} |
} |
69 |
|
|
70 |
async exec() { |
async exec() { |
71 |
return await this.commands[this.commandName].handle(this.msg, this); |
let cmd = this.commands[this.commandName]; |
72 |
|
|
73 |
|
if (cmd.needsOptionParse) { |
74 |
|
this.normalArgs = await this.args.filter(arg => arg[0] !== '-'); |
75 |
|
this.options = await this.args.filter(arg => arg[0] === '-'); |
76 |
|
} |
77 |
|
|
78 |
|
return await cmd.handle(this.msg, this); |
79 |
} |
} |
80 |
} |
} |
81 |
|
|