cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package cli provides command-line interface functionality for kusage. This package implements the command pattern and encapsulates all CLI-specific logic, including argument parsing, validation, and help text generation.

Index

Constants

View Source
const (
	// Name of the CLI program.
	Name = "kusage"
)

Variables

View Source
var (
	// Set at build time via -ldflags "-X main.version=..."
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Functions

func Run added in v0.1.0

func Run() error

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles command-line argument parsing and validation. This type implements the command pattern and encapsulates all CLI argument processing logic.

func NewParser

func NewParser() *Parser

NewParser creates a new CLI parser instance.

func (*Parser) Parse

func (p *Parser) Parse(args []string) (*config.Options, error)

Parse processes command-line arguments and returns a validated configuration. This method implements comprehensive argument parsing with proper error handling and validation, following CLI best practices for user experience.

func (*Parser) PrintUsage

func (p *Parser) PrintUsage()

PrintUsage outputs comprehensive usage information. This method provides detailed help text following Unix CLI conventions and includes examples for common use cases.

Jump to

Keyboard shortcuts

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