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

Commander => Add interactive mode

parent 5be5840e
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ class CommanderApp {
sortSubcommands : true
})
.option('-H, --host <string>', 'override the Dojo API endpoint', ClientsSharedConfig.apiURL)
.option('-I, --interactive', 'show interactive interface when available', Config.interactiveMode)
.addOption(new Option('--debug').hideHelp())
.hook('preAction', () => {
this.warnDevelopmentVersion();
......@@ -37,6 +38,10 @@ class CommanderApp {
ClientsSharedConfig.apiURL = this.program.opts().host;
});
this.program.on('option:interactive', () => {
Config.interactiveMode = this.program.opts().interactive;
});
this.program.on('option:debug', () => {
SharedConfig.debug = true;
});
......
......@@ -30,6 +30,8 @@ class Config {
neededFiles: Array<string>
};
public interactiveMode: boolean;
constructor() {
this.localConfig = {
folder : getAppDataPath('DojoCLI'),
......@@ -62,6 +64,8 @@ class Config {
this.exercise = {
neededFiles: JSON.parse(process.env.EXERCISE_NEEDED_FILES || '[]')
};
this.interactiveMode = process.env.INTERACTIVE_MODE === 'true';
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment