@indah_sekar/os-t 1.0.2 → 1.0.3
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/bin/cli.js +10 -14
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -57,7 +57,7 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
59
|
const categories = commands[os];
|
|
60
|
-
let
|
|
60
|
+
let allCmds = [];
|
|
61
61
|
for (const cat of categories) {
|
|
62
62
|
if (
|
|
63
63
|
categoryFilter &&
|
|
@@ -75,19 +75,15 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
75
75
|
c.command.toLowerCase().includes(q),
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
for (const cmd of cmds) {
|
|
88
|
-
console.log(` ${cmd.name.padEnd(maxNameLen)} ${cmd.description}`);
|
|
89
|
-
total++;
|
|
90
|
-
}
|
|
78
|
+
allCmds.push(...cmds);
|
|
79
|
+
}
|
|
80
|
+
if (allCmds.length === 0) continue;
|
|
81
|
+
const maxNameLen = Math.max(...allCmds.map((c) => c.name.length), 4);
|
|
82
|
+
console.log(`\n ${os}`);
|
|
83
|
+
console.log(` ${"name".padEnd(maxNameLen)} description`);
|
|
84
|
+
for (const cmd of allCmds) {
|
|
85
|
+
console.log(` ${cmd.name.padEnd(maxNameLen)} ${cmd.description}`);
|
|
86
|
+
total++;
|
|
91
87
|
}
|
|
92
88
|
}
|
|
93
89
|
console.log(`\n Total: ${total} command(s)`);
|