cli

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package cli implements the command-line interface for miru.

The cli package provides: - Command-line argument parsing and validation - Terminal output formatting - Man-like interface implementation - Interactive search functionality - Browser integration through environment configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPager

func NewPager(content string, styleName string, reloadFunc func() (string, api.Result, error), result api.Result) (*model, error)

NewPager creates a new pager model with the given content

func Run

func Run() error

Run executes the main CLI functionality

func RunPager

func RunPager(content string, styleName string, result api.Result) error

RunPager starts the pager program with the given content

func RunPagerWithReload

func RunPagerWithReload(content string, styleName string, reloadFunc func() (string, api.Result, error), result api.Result) error

RunPagerWithReload starts the pager program with the given content and reload function

Types

type ErrorCode

type ErrorCode string

ErrorCode defines error types for CLI operations

const (
	NoPackageSpecified  ErrorCode = "NoPackageSpecified"
	InvalidLanguageFlag ErrorCode = "InvalidLanguageFlag"
	InvalidLanguage     ErrorCode = "InvalidLanguage"
	InvalidArguments    ErrorCode = "InvalidArguments"
	UnsupportedLanguage ErrorCode = "UnsupportedLanguage"
	UnsupportedSource   ErrorCode = "UnsupportedSource"
	ErrInvalidURL       ErrorCode = "ErrInvalidURL"
)

func (ErrorCode) ErrorCode

func (c ErrorCode) ErrorCode() string

Jump to

Keyboard shortcuts

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