config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShellBash       = "bash"
	ShellZsh        = "zsh"
	ShellFish       = "fish"
	ShellPowerShell = "powershell"
)
View Source
const (
	RuleStringFlag = "rule-string"
	PlayFlag       = "play"
	CacheLimitFlag = "cache-limit"
	CompletionFlag = "completion"

	// Deprecated: Pass file as positional argument instead
	FileFlag = "file"
	// Deprecated: Pass URL as positional argument instead
	URLFlag = "url"
)

Variables

This section is empty.

Functions

func InitLog

func InitLog(level slog.Level)

func NewContext

func NewContext(ctx context.Context, conf *Config) context.Context

func RegisterCompletion

func RegisterCompletion(cmd *cobra.Command) error

Types

type Config

type Config struct {
	Pattern string

	PatternFormat string
	RuleString    string
	Play          bool
	CacheLimit    int

	Completion string
}

func FromContext

func FromContext(ctx context.Context) (*Config, bool)

func New

func New() *Config

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(fs *pflag.FlagSet)

type DeprecatedWriter

type DeprecatedWriter struct{}

func (DeprecatedWriter) Write

func (d DeprecatedWriter) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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