@brasil-interface/cli
Version:
23 lines • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const output_helper_1 = require("../../helpers/output-helper");
const sdks_1 = require("@brasil-interface/sdks");
const commander_1 = require("commander");
const viaCep = commander_1.program
.command("via-cep")
.description("ViaCepAPI utilities.");
viaCep
.command("get-by-number <cep>")
.description("PT-BR: Obtém informações de endereço pelo número do CEP. EN-US: Get address information by CEP number.")
.option("-o, --output <filepath>", "PT-BR: Caminho do arquivo de output. EN-US: Output file path")
.option("-c, --copy", "PT-BR: Copia o resultado para a área de transferência. EN-US: Copy the result to the clipboard.")
.action(async (cep, options) => {
const { output, copy } = options;
const viaCepAPI = new sdks_1.ViaCepAPI();
const result = await viaCepAPI.getCepByNumber(cep);
output_helper_1.OutputHelper.handleResultOutputBasedOnOptions(result, {
output,
copyToClipboard: copy,
});
});
//# sourceMappingURL=via-cep.js.map