"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class BoardShow extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "fancy";
    }
    async run() {
        const board = await this.client.boards.getBoard({
            id: this.lookups.board,
        });
        this.output(board);
    }
    toData(data) {
        return {
            id: data.id,
            name: data.name,
            description: data.desc,
            url: data.url,
            closed: data.closed,
            shortLink: data.shortLink,
        };
    }
    async format(data) {
        const lines = [
            `Name: ${data.name}`,
            `ID: ${data.id}`,
            `URL: ${data.url}`,
            `Status: ${data.closed ? "Closed" : "Open"}`,
            `Description: ${data.description || "None"}`,
        ];
        return lines.join("\n");
    }
}
BoardShow.description = "Show board details";
BoardShow.flags = {
    board: core_1.Flags.string({ required: true }),
};
exports.default = BoardShow;
