Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Update omelette and use package now-implemented tree
Browse files Browse the repository at this point in the history
  • Loading branch information
jblandry committed Oct 5, 2017
1 parent 14588ad commit f18deaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
31 changes: 2 additions & 29 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,35 +92,8 @@ const initAutocomplete = () => {
});


// Breks eggs
const complete = omelette(pkg.name);

complete.on('$1', function() {
try {
this.reply(Object.keys(autocomplete));
} catch (e) {} // eslint-disable-line no-empty
});

complete.on('$2', function(lvl1) {
try {
this.reply(Object.keys(autocomplete[lvl1]));
} catch (e) {} // eslint-disable-line no-empty
});

complete.on('$3', function(lvl2, line) {
const [, lvl1] = line.split(' ');
try {
this.reply(Object.keys(autocomplete[lvl1][lvl2]));
} catch (e) {} // eslint-disable-line no-empty
});

complete.on('$4', function(lvl3, line) {
const [, lvl1, lvl2] = line.split(' ');
try {
this.reply(Object.keys(autocomplete[lvl1][lvl2][lvl3]));
} catch (e) {} // eslint-disable-line no-empty
});

// Breaks eggs
const complete = omelette(pkg.name).tree(autocomplete);
complete.init();
};

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@absolunet/cli",
"version": "0.4.1",
"version": "0.4.2",
"description": "CLI utilities",
"definition": "",
"homepage": "https://github.com/absolunet/node-cli",
Expand All @@ -26,11 +26,12 @@
"@absolunet/tester": "1.1.0"
},
"dependencies": {
"@absolunet/terminal": "^0.4.4",
"@absolunet/terminal-pad": "^0.0.2",
"chalk": "^2.1.0",
"glob": "^7.1.2",
"indent-string": "^3.2.0",
"omelette": "^0.3.2",
"omelette": "^0.4.5",
"read-pkg-up": "^2.0.0",
"string-width": "^2.1.1"
}
Expand Down

0 comments on commit f18deaa

Please sign in to comment.