Skip to content

Commit

Permalink
chore: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kakha urigashvili committed Nov 10, 2020
1 parent 533b568 commit 02cbcdf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/commands/autocomplete/helper.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
const fs = require('fs-extra');
const path = require('path');

module.exports = class Helper {
constructor(omelette, commanders = []) {
this.commanders = commanders;
this.completion = omelette('ask');
this.autoCompleteHintsFile = 'autocomplete-hints.json';
this.autoCompleteHintsFile = path.join(__dirname, 'autocomplete-hints.json');
}

_getAutoCompleteOptions() {
const options = {};
this.commanders.forEach(com => {
options[com.name()] = [];
com.commands.forEach(sumCom => {
options[com.name()].push(sumCom.name());
});
options[com.name()] = com.commands.map(sumCom => sumCom.name());
});

return options;
Expand Down

0 comments on commit 02cbcdf

Please sign in to comment.