UNPKG

solidity-docgen

Version:

Solidity API documentation automatic generator.

76 lines 2.92 kB
#!/usr/bin/env node "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("@oclif/command"); const path_1 = __importDefault(require("path")); const docgen_1 = require("./docgen"); class Docgen extends command_1.Command { run() { return __awaiter(this, void 0, void 0, function* () { const { flags } = this.parse(Docgen); yield docgen_1.docgen(flags); }); } } Docgen.flags = { version: command_1.flags.version(), help: command_1.flags.help(), input: command_1.flags.string({ char: 'i', default: 'contracts', description: 'directory where contracts will be taken from', }), output: command_1.flags.string({ char: 'o', default: 'docs', description: 'directory where generated docs will be written', }), exclude: command_1.flags.build({ parse: s => s.split(','), })({ char: 'e', description: 'exclude directories that match the pattern (separated by commas)', }), templates: command_1.flags.string({ char: 't', parse: s => path_1.default.resolve(s), description: 'directory with template files', }), extension: command_1.flags.string({ char: 'x', default: 'md', description: 'file extension for generated pages, not necessary when using READMEs', }), 'solc-module': command_1.flags.string({ parse: s => path_1.default.resolve(s), description: 'path to an alternative solc module', }), 'solc-settings': command_1.flags.build({ parse: s => { const settings = JSON.parse(s); if (typeof settings !== 'object' || settings === null) { throw new Error('--solc-settings must be an object'); } return settings; }, })({ description: 'compiler settings for solc module', }), 'contract-pages': command_1.flags.boolean({ default: false, description: 'enable one page per contract', }), }; Docgen.run().then(undefined, require('@oclif/errors/handle')); //# sourceMappingURL=cli.js.map