"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class ListList extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "fancy";
    }
    async run() {
        const boards = await this.client.boards.getBoardLists({
            id: this.lookups.board,
            filter: this.flags.filter,
        });
        this.output(boards);
    }
    toData(data) {
        return data.map((d) => {
            return {
                id: d.id,
                name: d.name,
            };
        });
    }
    format(data) {
        return data
            .map((b) => {
            return `${b.name} (ID: ${b.id})`;
        })
            .join("\n");
    }
}
ListList.description = "Show all lists on a board";
ListList.flags = {
    board: core_1.Flags.string({ required: true }),
    filter: core_1.Flags.option({
        options: ["all", "closed", "none", "open"],
        default: "open",
    })(),
};
exports.default = ListList;
