config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() string

Path returns the config file path, respecting XDG_CONFIG_HOME.

Types

type Config

type Config struct {
	Disabled []string
}

Config holds user preferences loaded from ~/.config/chop/config.yml.

func Load

func Load() Config

Load reads the config file and returns a Config. Returns defaults if the file doesn't exist or can't be parsed.

func LoadFrom

func LoadFrom(path string) Config

LoadFrom reads config from a specific path. Exported for testing.

func LoadWithLocal added in v1.1.0

func LoadWithLocal(cwd string) Config

LoadWithLocal loads the global config, then overlays a local .chop.yml from the given directory (if it exists). The local disabled list fully replaces the global one.

func (Config) IsDisabled

func (c Config) IsDisabled(command string, args ...string) bool

IsDisabled returns true if the given base command (and optional subcommand) matches an entry in the disabled list.

Matching rules:

  • "git" disables all git subcommands
  • "git diff" disables only "git diff"

Call with: IsDisabled("git", "diff") or IsDisabled("git")

Jump to

Keyboard shortcuts

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