Skip to content

Commit 043d8dc

Browse files
committed
ref(org): use shared list-command constants in org list
Use buildListLimitFlag, LIST_JSON_FLAG, and LIST_BASE_ALIASES from list-command.ts to replace the inline flag definitions. Adds the missing -n alias for --limit, consistent with all other list commands.
1 parent 981435c commit 043d8dc

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/commands/org/list.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import type { SentryContext } from "../../context.js";
88
import { listOrganizations } from "../../lib/api-client.js";
9-
import { buildCommand, numberParser } from "../../lib/command.js";
9+
import { buildCommand } from "../../lib/command.js";
1010
import { DEFAULT_SENTRY_HOST } from "../../lib/constants.js";
1111
import { getAllOrgRegions } from "../../lib/db/regions.js";
1212
import {
@@ -15,6 +15,7 @@ import {
1515
writeFooter,
1616
writeJson,
1717
} from "../../lib/formatters/index.js";
18+
import { buildListLimitFlag, LIST_JSON_FLAG } from "../../lib/list-command.js";
1819

1920
type ListFlags = {
2021
readonly limit: number;
@@ -69,19 +70,11 @@ export const listCommand = buildCommand({
6970
},
7071
parameters: {
7172
flags: {
72-
limit: {
73-
kind: "parsed",
74-
parse: numberParser,
75-
brief: "Maximum number of organizations to list",
76-
// Stricli requires string defaults (raw CLI input); numberParser converts to number
77-
default: "30",
78-
},
79-
json: {
80-
kind: "boolean",
81-
brief: "Output JSON",
82-
default: false,
83-
},
73+
limit: buildListLimitFlag("organizations"),
74+
json: LIST_JSON_FLAG,
8475
},
76+
// Only -n for --limit; no -c since org list has no --cursor flag
77+
aliases: { n: "limit" },
8578
},
8679
async func(this: SentryContext, flags: ListFlags): Promise<void> {
8780
const { stdout } = this;

0 commit comments

Comments
 (0)