Skip to content
Snippets Groups Projects
Commit 88236f24 authored by michael.minelli's avatar michael.minelli
Browse files

CommanderCommand => Add possibility to have aliases and command options

parent 426f6e82
No related branches found
No related tags found
1 merge request!10Resolve "Add sonar integration"
import { Command } from 'commander'; import { Command, CommandOptions } from 'commander';
abstract class CommanderCommand { abstract class CommanderCommand {
protected abstract commandName: string; protected abstract commandName: string;
protected aliasNames: Array<string> = [];
protected options: CommandOptions = {};
command: Command = new Command(); command: Command = new Command();
registerOnCommand(parent: Command) { registerOnCommand(parent: Command) {
this.command = parent.command(this.commandName); this.command = parent.command(this.commandName, this.options).aliases(this.aliasNames);
this.defineCommand(); this.defineCommand();
this.defineSubCommands(); this.defineSubCommands();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment