@cristiand391/oclif-carapace-spec-plugin
Version:
oclif plugin to generate a carapace spec
46 lines (45 loc) • 1.03 kB
TypeScript
import { Command } from '@oclif/core';
import { YAMLMap } from 'yaml';
type YamlCommandNode = {
name: string;
description: string;
commands: YamlCommandNode[];
flags?: YAMLMap;
completion?: {
flag: {
[key: string]: string[];
};
};
exclusiveflags?: string[][];
};
type CommandNode = {
flags?: {
[name: string]: Command.Flag.Cached;
};
id: string;
summary: string;
};
type TopicNode = {
id: string;
summary: string;
};
type Node = CommandNode | TopicNode;
type Macros = {
persistentFlagsCompletion?: {
[name: string]: string[];
};
commandOverrides?: {
flags?: {
[name: string]: {
[name: string]: string[];
};
};
};
};
type CommandTree = {
name: string;
description: string;
commands: YamlCommandNode[];
};
export declare function buildCommandTree(nodes: Node[], macros: Macros | undefined, bin: string, description: string): CommandTree;
export {};