cli

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandPaths

func ExpandPaths(paths []string) ([]string, error)

ExpandPaths expands path patterns like "./..." into actual package paths

Types

type Options

type Options struct {
	// SourceFile is the path to a specific Go source file to process
	SourceFile string

	// PackagePath is the path to a package directory to process
	PackagePath string

	// PositionalArgs are the non-flag arguments (e.g., "./..." or "./pkg")
	PositionalArgs []string

	// Help indicates if help was requested
	Help bool

	// Version indicates if version was requested
	Version bool
}

Options represents the parsed command-line options

func ParseArgs

func ParseArgs(args []string) (*Options, error)

ParseArgs parses command-line arguments and returns Options

func (*Options) GetProcessingTarget

func (opts *Options) GetProcessingTarget() *ProcessingTarget

GetProcessingTarget determines what Oak should process based on the options

func (*Options) Validate

func (opts *Options) Validate() error

Validate checks the options for conflicts and invalid combinations

type ProcessingMode

type ProcessingMode int

ProcessingMode represents how Oak should process files/packages

const (
	// ModeConfig processes packages based on oak.yaml configuration
	ModeConfig ProcessingMode = iota

	// ModeSourceFile processes a specific source file
	ModeSourceFile

	// ModePackage processes a specific package
	ModePackage

	// ModePositional processes based on positional arguments
	ModePositional
)

type ProcessingTarget

type ProcessingTarget struct {
	Mode     ProcessingMode
	Paths    []string
	UseFlags bool // true if flags were used, false if positional args
}

ProcessingTarget represents what Oak should process

Jump to

Keyboard shortcuts

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