We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3edee26 commit 51af1e1Copy full SHA for 51af1e1
lib/utils/commands.js
@@ -1,10 +1,12 @@
1
const arguments = require('./cli-flags');
2
3
-const names = [];
4
-arguments.commands.forEach( command => {
5
- names.push(command.name);
6
- if (command.alias) names.push(command.alias);
7
-})
+const info = arguments.commands;
+const names = Object.keys(info).map( i => {
+ if (info[i].alias) {
+ return [info[i].name, info[i].alias];
+ }
8
+ return [info[i].name];
9
+}).reduce((arr, val) => arr.concat(val), []);
10
11
module.exports.names = names;
12
module.exports.info = arguments.commands;
0 commit comments