node-power-user 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +10 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -16,12 +16,19 @@ const ALIASES = {
|
|
|
16
16
|
|
|
17
17
|
// Function to resolve command name from aliases
|
|
18
18
|
function resolveCommand(command) {
|
|
19
|
+
console.log('---1 command', command);
|
|
19
20
|
for (const [key, aliases] of Object.entries(ALIASES)) {
|
|
21
|
+
console.log('---2 key, aliases', key, aliases);
|
|
22
|
+
|
|
20
23
|
if (command === key || aliases.includes(command)) {
|
|
24
|
+
console.log('---3');
|
|
21
25
|
return key;
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
|
|
29
|
+
// Default to original command if no alias is found
|
|
30
|
+
console.log('---4');
|
|
31
|
+
return command;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
// Main Function
|
|
@@ -29,6 +36,8 @@ function Main() {}
|
|
|
29
36
|
|
|
30
37
|
Main.prototype.process = async function (options) {
|
|
31
38
|
// Determine the command (use default if not provided)
|
|
39
|
+
console.log('---options', options);
|
|
40
|
+
|
|
32
41
|
const inputCommand = options._[0] || DEFAULT;
|
|
33
42
|
const command = resolveCommand(inputCommand);
|
|
34
43
|
|