@withfig/commander
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -0,1 +1,2 @@ | ||
/// <reference types="@withfig/autocomplete-types" /> | ||
import type { Command } from "commander"; | ||
@@ -6,2 +7,3 @@ export interface Options { | ||
} | ||
export declare function generateCommand(_command: Command & Record<string, any>, figSpecCommandName: string): Fig.Subcommand | undefined; | ||
export declare function generateFigSpec(command: Command, filename: string, options?: Options): void; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateFigSpec = void 0; | ||
exports.generateFigSpec = exports.generateCommand = void 0; | ||
const fs_1 = require("fs"); | ||
@@ -93,3 +93,3 @@ const path_1 = __importDefault(require("path")); | ||
function generateCommand(_command, figSpecCommandName) { | ||
const { _name, _description, _aliases, commands, _args, options, _addImplicitHelpCommandL, _hasHelpOption, } = _command; | ||
const { _name, _description, _aliases, commands, _args, options, _addImplicitHelpCommandL, _hasHelpOption, _hidden, } = _command; | ||
if (_name === figSpecCommandName) | ||
@@ -101,2 +101,4 @@ return undefined; | ||
command.description = _description; | ||
if (_hidden) | ||
command.hidden = true; | ||
// Subcommands | ||
@@ -128,2 +130,3 @@ if (commands.length) { | ||
} | ||
exports.generateCommand = generateCommand; | ||
function generateFigSpec(command, filename, options) { | ||
@@ -130,0 +133,0 @@ const cwd = (options === null || options === void 0 ? void 0 : options.cwd) || process.cwd(); |
{ | ||
"name": "@withfig/commander", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Export commander command as a Fig spec", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10926
140
0