@startanaicompany/techsaac-cli 0.0.3 → 0.0.4
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 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -98,7 +98,15 @@ function formatTable(rows) {
|
|
|
98
98
|
if (cols.length === 0)
|
|
99
99
|
return JSON.stringify(rows, null, 2);
|
|
100
100
|
// Calculate widths
|
|
101
|
-
const widths = cols.map(c =>
|
|
101
|
+
const widths = cols.map(c => {
|
|
102
|
+
const maxDataWidth = Math.max(c.length, ...rows.map(r => String(r[c] ?? '').length));
|
|
103
|
+
// Don't truncate columns that look like keys/IDs (hashes, UUIDs)
|
|
104
|
+
const looksLikeKey = rows.some(r => {
|
|
105
|
+
const v = String(r[c] ?? '');
|
|
106
|
+
return v.length > 50 && /^[a-f0-9-]+$/i.test(v);
|
|
107
|
+
});
|
|
108
|
+
return looksLikeKey ? maxDataWidth : Math.min(50, maxDataWidth);
|
|
109
|
+
});
|
|
102
110
|
const header = cols.map((c, i) => c.padEnd(widths[i])).join(' ');
|
|
103
111
|
const separator = widths.map(w => '─'.repeat(w)).join('──');
|
|
104
112
|
const body = rows.map(r => cols
|
|
@@ -330,7 +338,7 @@ Examples:
|
|
|
330
338
|
`);
|
|
331
339
|
}
|
|
332
340
|
// ─── Main ───────────────────────────────────────────────────────────────────
|
|
333
|
-
const VERSION = '0.0.
|
|
341
|
+
const VERSION = '0.0.4';
|
|
334
342
|
async function main() {
|
|
335
343
|
const args = process.argv.slice(2);
|
|
336
344
|
if (args.length === 0 || args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
|