diff --git a/NodeApp/src/commander/CommanderApp.ts b/NodeApp/src/commander/CommanderApp.ts index 03814c8a2394417570e34c1cde3618c7e89cfd2b..f32b3d79c7495f13c06da4940f20b27ab0feec0f 100644 --- a/NodeApp/src/commander/CommanderApp.ts +++ b/NodeApp/src/commander/CommanderApp.ts @@ -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; }); diff --git a/NodeApp/src/config/Config.ts b/NodeApp/src/config/Config.ts index b0d2df81c57e001728eeda4166110d153c2eaf96..375f0cf22034eb73d958b8d711efe8fa9af9eb72 100644 --- a/NodeApp/src/config/Config.ts +++ b/NodeApp/src/config/Config.ts @@ -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'; } }