Migrated from parseArgs from node:util to commander.js.
All checks were successful
build / build (push) Successful in 14s

This commit is contained in:
2026-03-10 07:15:00 +01:00
parent a98c77cd2e
commit 9fd770999b
12 changed files with 220 additions and 242 deletions

View File

@@ -2,7 +2,10 @@
import { listAppGrants } from "../../graph/app.ts";
import { getGraphClient } from "../../graph/index.ts";
import type { CommandValues } from "./types.ts";
type ListAppGrantsOptions = {
appId?: string;
};
export function usageListAppGrants(): string {
return `Usage: sk-az-tools list-app-grants --app-id|-i <appId> [global options]
@@ -11,11 +14,11 @@ Options:
--app-id, -i <appId> Application (client) ID (required)`;
}
export async function runListAppGrantsCommand(values: CommandValues): Promise<unknown> {
if (!values["app-id"]) {
export async function runListAppGrantsCommand(options: ListAppGrantsOptions): Promise<unknown> {
if (!options.appId) {
throw new Error("--app-id is required for list-app-grants");
}
const client = await getGraphClient();
return listAppGrants(client, values["app-id"]);
return listAppGrants(client, options.appId);
}