Refactor CLI commands: remove table command and related utilities; update dependencies and version
All checks were successful
build / build (push) Successful in 17s

This commit is contained in:
2026-03-06 19:05:34 +01:00
parent 03fb55d97f
commit 2fa9462657
10 changed files with 35 additions and 460 deletions

View File

@@ -1,28 +0,0 @@
// SPDX-License-Identifier: MIT
import { readCsvFromStdin, readJsonFromStdin } from "../utils.ts";
import type { CommandValues } from "./types.ts";
export function usageTable(): string {
return `Usage: sk-az-tools table [--from|-F <json|csv|tsv>] [--header|-H <definition|auto|a|original|o>] [global options]
Options:
--from, -F <json|csv|tsv> Input format on stdin (default: json)
--header, -H <value> Header mode: auto|a (default), original|o, or "col1, col2" or "key1: Label 1, key2: Label 2"`;
}
export async function runTableCommand(values: CommandValues): Promise<unknown> {
const from = (values.from ?? "json").toString().trim().toLowerCase();
if (from === "json") {
return readJsonFromStdin();
}
if (from === "csv") {
return readCsvFromStdin(",");
}
if (from === "tsv") {
return readCsvFromStdin("\t");
}
throw new Error(`Invalid --from '${values.from}'. Allowed: json, csv, tsv`);
}

View File

@@ -3,7 +3,6 @@
export type CommandValues = {
[key: string]: string | boolean | undefined;
type?: string;
from?: string;
method?: string;
url?: string;
header?: string;