"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.configCommand = void 0;
const accounts_1 = require("../accounts");
const logger_1 = __importDefault(require("../logger"));
function configCommand(program) {
    const configCommand = program.command('config').description('Edit configuration settings');
    const getCommand = configCommand.command('get').description('Get configuration settings.');
    const setCommand = configCommand.command('set').description('Set configuration settings.');
    getCommand
        .command('email')
        .description('Get user email')
        .action(() => {
        const email = (0, accounts_1.getUserEmail)();
        if (email) {
            logger_1.default.info(email);
        }
        else {
            logger_1.default.info('No email set.');
        }
    });
    setCommand
        .command('email <email>')
        .description('Set user email')
        .action((email) => {
        (0, accounts_1.setUserEmail)(email);
        if (email) {
            logger_1.default.info(`Email set to ${email}`);
        }
        else {
            logger_1.default.info('Email unset.');
        }
    });
}
exports.configCommand = configCommand;
//# sourceMappingURL=config.js.map