Update: Refactored commands into their own source files.
This commit is contained in:
22
src/cli/commands/list-app-grants.ts
Normal file
22
src/cli/commands/list-app-grants.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { listAppGrants } from "../../graph/app.ts";
|
||||
|
||||
import { getGraphClientFromPublicConfig } from "./shared.ts";
|
||||
import type { CommandValues } from "./types.ts";
|
||||
|
||||
export function usageListAppGrants(): string {
|
||||
return `Usage: sk-az-tools list-app-grants --app-id|-i <appId> [global options]
|
||||
|
||||
Options:
|
||||
-i, --app-id <appId> Application (client) ID (required)`;
|
||||
}
|
||||
|
||||
export async function runListAppGrantsCommand(values: CommandValues): Promise<unknown> {
|
||||
if (!values["app-id"]) {
|
||||
throw new Error("--app-id is required for list-app-grants");
|
||||
}
|
||||
|
||||
const { client } = await getGraphClientFromPublicConfig();
|
||||
return listAppGrants(client, values["app-id"]);
|
||||
}
|
||||
Reference in New Issue
Block a user