@indah_sekar/os-t 1.0.1 → 1.0.2
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/README.md +1 -0
- package/bin/cli.js +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,3 +74,4 @@ import commands from "@indah-sekar/os-t";
|
|
|
74
74
|
- **Export History** — Download terminal history as a text file
|
|
75
75
|
- **Difficulty Indicators** — See at a glance whether a command is easy, medium, or hard
|
|
76
76
|
- **CLI Tool** — Use from the command line after `npm install -g`
|
|
77
|
+
"# os-t"
|
package/bin/cli.js
CHANGED
|
@@ -80,8 +80,12 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
80
80
|
console.log(`\n ${os}`);
|
|
81
81
|
osHeaderPrinted = true;
|
|
82
82
|
}
|
|
83
|
+
const maxNameLen = Math.max(...cmds.map((c) => c.name.length), 4);
|
|
84
|
+
console.log(
|
|
85
|
+
` ${"name".padEnd(maxNameLen)} description`,
|
|
86
|
+
);
|
|
83
87
|
for (const cmd of cmds) {
|
|
84
|
-
console.log(` ${cmd.
|
|
88
|
+
console.log(` ${cmd.name.padEnd(maxNameLen)} ${cmd.description}`);
|
|
85
89
|
total++;
|
|
86
90
|
}
|
|
87
91
|
}
|
|
@@ -142,13 +146,14 @@ function prepareCommand(cmd, os) {
|
|
|
142
146
|
|
|
143
147
|
function printResults(results) {
|
|
144
148
|
let currentOs = null;
|
|
149
|
+
const maxNameLen = Math.max(...results.map((r) => r.name.length), 4);
|
|
145
150
|
for (const r of results) {
|
|
146
|
-
const finalCmd = prepareCommand(r.command, r.os);
|
|
147
151
|
if (r.os !== currentOs) {
|
|
148
152
|
console.log(`\n ${r.os}`);
|
|
153
|
+
console.log(` ${"name".padEnd(maxNameLen)} description`);
|
|
149
154
|
currentOs = r.os;
|
|
150
155
|
}
|
|
151
|
-
console.log(` ${
|
|
156
|
+
console.log(` ${r.name.padEnd(maxNameLen)} ${r.description}`);
|
|
152
157
|
}
|
|
153
158
|
console.log(`\n Found: ${results.length} command(s)`);
|
|
154
159
|
}
|