config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	//
	// CLI options, envs
	//
	Query     string `name:"query" short:"x" default:"stdin" usage:"music query"`
	Dry       bool   `name:"dry" short:"l" usage:"dryrun"`
	Lines     int    `name:"lines" short:"n" usage:"head count"`
	Loop      bool   `name:"loop" usage:"loop playlist"`
	Reload    bool   `name:"reload" usage:"reload index"`
	Normalize bool   `name:"normalize" usage:"reload normalized index"`
	Shuffle   bool   `name:"shuffle" default:"true" usage:"shuffle music"`
	MusicRoot string `name:"music_root" short:"r" usage:"required, root directory of music files"`
	Debug     bool   `name:"debug" usage:"enable debug logs"`
	Quiet     bool   `name:"quiet" short:"q" usage:"quiet logs"`
	PlayOnly  bool   `` /* 157-byte string literal not displayed */
	Window    bool   `name:"window" short:"w" usage:"pretend GUI application"`
	//
	// external commands
	//
	MetafindCmd string `name:"metafind" default:"mf" usage:"metafind command, recommended: v0.6.1"`
	MpvCmd      string `name:"mpv" default:"mpv" usage:"mpv command, recommended: v0.40.0"`
	GrepCmd     string `name:"grep" default:"grep" usage:"grep command"`
	JqCmd       string `name:"jq" default:"jq" usage:"jq command, recommended: 1.8.1"`
	FfprobeCmd  string `name:"ffprobe" default:"ffprobe" usage:"ffprobe command, recommended: 7.1.1"`
	//
	// dependent variables
	//
	CacheDir string   `name:"-"`
	ListArgs []string `name:"-"`
	GrepArgs []string `name:"-"`
	//
	// etc
	//
	Writer io.Writer `name:"-" json:"-"`
}

func (*Config) IndexFile

func (c *Config) IndexFile() string

func (*Config) MetafindConfig

func (c *Config) MetafindConfig() (string, error)

func (*Config) NormalizedIndexFile

func (c *Config) NormalizedIndexFile() string

func (*Config) SetupLogger

func (c *Config) SetupLogger(w io.Writer)

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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