@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.
Files changed (2) hide show
  1. package/bin/cli.js +10 -14
  2. 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 osHeaderPrinted = false;
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
- if (cmds.length === 0) continue;
79
- if (!osHeaderPrinted) {
80
- console.log(`\n ${os}`);
81
- osHeaderPrinted = true;
82
- }
83
- const maxNameLen = Math.max(...cmds.map((c) => c.name.length), 4);
84
- console.log(
85
- ` ${"name".padEnd(maxNameLen)} description`,
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)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indah_sekar/os-t",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Quick troubleshooting commands for Windows, Linux & macOS. CLI tool + web app.",
5
5
  "keywords": [
6
6
  "troubleshooting",