diff --git a/src/commands/project/list.ts b/src/commands/project/list.ts index 3f4ecb7..0a0abd8 100644 --- a/src/commands/project/list.ts +++ b/src/commands/project/list.ts @@ -6,12 +6,17 @@ import { formatProject, getAll, getContract, getProvider, parseAddress, pretty } export default class ProjectList extends BlockchainCommand { static summary = "List projects on the EarthFast Network."; static examples = ["<%= config.bin %> <%= command.id %>"]; - static usage = "<%= command.id %> [--owner ADDR] [--skip N] [--size N] [--page N]"; + static usage = "<%= command.id %> [--owner ADDR] [--skip N] [--size N] [--page N] [--enabled-only]"; static flags = { owner: Flags.string({ description: "Filter by owner address.", helpValue: "ADDR" }), skip: Flags.integer({ description: "The number of results to skip.", helpValue: "N", default: 0 }), size: Flags.integer({ description: "The number of results to list.", helpValue: "N", default: 100 }), page: Flags.integer({ description: "The contract call paging size.", helpValue: "N", default: 100 }), + enabledOnly: Flags.boolean({ + description: "Show only enabled nodes.", + default: false, + char: "e", + }), }; public async run(): Promise[]> { @@ -26,6 +31,9 @@ export default class ProjectList extends BlockchainCommand { if (flags.owner) { results = results.filter((v) => v.owner.toLowerCase() === owner.toLowerCase()); } + if (flags.enabledOnly) { + results = results.filter((v) => !v.disabled); + } const records = results.slice(flags.skip, flags.skip + flags.size); const output = records.map((r) => formatProject(r));