settings

package
v10.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Describes Sorting method for numberdisplay
	BottomUp = iota
	TopDown
)

Variables

View Source
var HideMenus = false

HideMenus indicates if pacman's provider menus must be hidden

View Source
var NoConfirm = false

NoConfirm indicates if user input should be skipped

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	Op      string
	Options map[string]*Option
	Targets []string
}

Arguments Parses command line arguments in a way we can interact with programmatically but also in a way that can easily be passed to pacman later on.

func MakeArguments

func MakeArguments() *Arguments

func (*Arguments) AddArg

func (a *Arguments) AddArg(options ...string) error

func (*Arguments) AddTarget

func (a *Arguments) AddTarget(targets ...string)

func (*Arguments) ClearTargets

func (a *Arguments) ClearTargets()

func (*Arguments) Copy

func (a *Arguments) Copy() (cp *Arguments)

func (*Arguments) CopyGlobal

func (a *Arguments) CopyGlobal() *Arguments

func (*Arguments) CreateOrAppendOption added in v10.0.4

func (a *Arguments) CreateOrAppendOption(option string, values ...string)

func (*Arguments) DelArg

func (a *Arguments) DelArg(options ...string)

func (*Arguments) ExistsArg

func (a *Arguments) ExistsArg(options ...string) bool

Multiple args acts as an OR operator

func (*Arguments) ExistsDouble

func (a *Arguments) ExistsDouble(options ...string) bool

Multiple args acts as an OR operator

func (*Arguments) FormatArgs

func (a *Arguments) FormatArgs() (args []string)

func (*Arguments) FormatGlobals

func (a *Arguments) FormatGlobals() (args []string)

func (*Arguments) GetArg

func (a *Arguments) GetArg(options ...string) (arg string, double, exists bool)

func (*Arguments) GetArgs added in v10.0.4

func (a *Arguments) GetArgs(option string) (args []string)

func (*Arguments) NeedRoot

func (a *Arguments) NeedRoot(runtime *Runtime) bool

func (*Arguments) ParseCommandLine

func (a *Arguments) ParseCommandLine(config *Configuration) error

func (*Arguments) String

func (a *Arguments) String() string

type Configuration

type Configuration struct {
	AURURL             string   `json:"aururl"`
	BuildDir           string   `json:"buildDir"`
	ABSDir             string   `json:"absdir"`
	Editor             string   `json:"editor"`
	EditorFlags        string   `json:"editorflags"`
	MakepkgBin         string   `json:"makepkgbin"`
	MakepkgConf        string   `json:"makepkgconf"`
	PacmanBin          string   `json:"pacmanbin"`
	PacmanConf         string   `json:"pacmanconf"`
	ReDownload         string   `json:"redownload"`
	ReBuild            string   `json:"rebuild"`
	AnswerClean        string   `json:"answerclean"`
	AnswerDiff         string   `json:"answerdiff"`
	AnswerEdit         string   `json:"answeredit"`
	AnswerUpgrade      string   `json:"answerupgrade"`
	GitBin             string   `json:"gitbin"`
	GpgBin             string   `json:"gpgbin"`
	GpgFlags           string   `json:"gpgflags"`
	MFlags             string   `json:"mflags"`
	SortBy             string   `json:"sortby"`
	SearchBy           string   `json:"searchby"`
	GitFlags           string   `json:"gitflags"`
	RemoveMake         string   `json:"removemake"`
	SudoBin            string   `json:"sudobin"`
	SudoFlags          string   `json:"sudoflags"`
	RequestSplitN      int      `json:"requestsplitn"`
	SearchMode         int      `json:"-"`
	SortMode           int      `json:"sortmode"`
	CompletionInterval int      `json:"completionrefreshtime"`
	SudoLoop           bool     `json:"sudoloop"`
	TimeUpdate         bool     `json:"timeupdate"`
	Devel              bool     `json:"devel"`
	CleanAfter         bool     `json:"cleanAfter"`
	Provides           bool     `json:"provides"`
	PGPFetch           bool     `json:"pgpfetch"`
	UpgradeMenu        bool     `json:"upgrademenu"`
	CleanMenu          bool     `json:"cleanmenu"`
	DiffMenu           bool     `json:"diffmenu"`
	EditMenu           bool     `json:"editmenu"`
	CombinedUpgrade    bool     `json:"combinedupgrade"`
	UseAsk             bool     `json:"useask"`
	BatchInstall       bool     `json:"batchinstall"`
	Runtime            *Runtime `json:"-"`
}

Configuration stores yay's config.

func DefaultConfig added in v10.1.0

func DefaultConfig() *Configuration

func NewConfig added in v10.1.0

func NewConfig(version string) (*Configuration, error)

func (*Configuration) Save added in v10.1.0

func (c *Configuration) Save(configPath string) error

SaveConfig writes yay config to file.

func (*Configuration) String

func (c *Configuration) String() string

type Option

type Option struct {
	Global bool
	Args   []string
}

func (*Option) Add

func (o *Option) Add(args ...string)

func (*Option) First

func (o *Option) First() string

func (*Option) Set

func (o *Option) Set(arg string)

func (*Option) String

func (o *Option) String() string

type Runtime

type Runtime struct {
	Mode           TargetMode
	SaveConfig     bool
	CompletionPath string
	ConfigPath     string
	PacmanConf     *pacmanconf.Config
	VCSStore       *vcs.InfoStore
	CmdBuilder     *exe.CmdBuilder
	CmdRunner      exe.Runner
	HTTPClient     *http.Client
	AURClient      *aur.Client
}

type TargetMode

type TargetMode int
const (
	ModeAny TargetMode = iota
	ModeAUR
	ModeRepo
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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