commands

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package commands defines the CLI command structure for the yapi application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRoot

func BuildRoot(cfg *Config, handlers *Handlers) *cobra.Command

BuildRoot builds the root command tree with optional handlers. If handlers is nil, commands are built without RunE functions (for doc generation).

Types

type Config

type Config struct {
	URLOverride string
	NoColor     bool
}

Config holds configuration for command execution

type Handlers

type Handlers struct {
	RunInteractive func(cmd *cobra.Command, args []string) error
	Run            func(cmd *cobra.Command, args []string) error
	Watch          func(cmd *cobra.Command, args []string) error
	History        func(cmd *cobra.Command, args []string) error
	LSP            func(cmd *cobra.Command, args []string) error
	Version        func(cmd *cobra.Command, args []string) error
	Validate       func(cmd *cobra.Command, args []string) error
	Share          func(cmd *cobra.Command, args []string) error
}

Handlers contains the callback functions for command execution

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL