UNPKG

@authereum/zos

Version:

Command-line interface for the ZeppelinOS smart contract platform

32 lines 1.75 kB
'use strict'; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const chalk_1 = __importDefault(require("chalk")); const commander_1 = __importDefault(require("commander")); const zos_lib_1 = require("zos-lib"); const commands_1 = __importDefault(require("../commands")); const errors_1 = __importDefault(require("./errors")); // Do not use import here or Typescript will create wrong build folder // eslint-disable-next-line @typescript-eslint/no-var-requires const { version } = require('../../package.json'); require('./options'); let commandsList = Object.values(commands_1.default); commandsList.forEach((command) => command.register(commander_1.default)); // Remove the status command from the command list commandsList = commandsList.filter(c => c.name !== 'status'); const maxLength = Math.max(...commandsList.map(command => command.signature.length)); commander_1.default .name('zos') .usage('<command> [options]') .description(`where <command> is one of: ${commandsList.map(c => c.name).join(', ')}`) .version(version, '--version') .option('-v, --verbose', 'verbose mode on: output errors stacktrace and detailed log.') .option('-s, --silent', 'silent mode: no output sent to stderr.') .on('option:verbose', () => zos_lib_1.Loggy.verbose(true)) .on('option:silent', () => zos_lib_1.Loggy.silent(true)) .on('--help', () => commandsList.forEach(c => console.log(` ${chalk_1.default.bold(c.signature.padEnd(maxLength))}\t${c.description}\n`))); errors_1.default(commander_1.default); exports.default = commander_1.default; //# sourceMappingURL=program.js.map