summaryrefslogtreecommitdiffstats
path: root/pkg/config/app_config.go
blob: 98e56dea20bdd149d596312869d830b3b0108d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package config

// AppConfig contains the base configuration fields required for lazygit.
type AppConfig struct {
	Debug     bool   `long:"debug" env:"DEBUG" default:"false"`
	Version   string `long:"version" env:"VERSION" default:"unversioned"`
	Commit    string `long:"commit" env:"COMMIT"`
	BuildDate string `long:"build-date" env:"BUILD_DATE"`
	Name      string `long:"name" env:"NAME" default:"lazygit"`
}

// AppConfigurer interface allows individual app config structs to inherit Fields
// from AppConfig and still be used by lazygit.
type AppConfigurer interface {
	GetDebug() bool
	GetVersion() string
	GetCommit() string
	GetBuildDate() string
	GetName() string
}

// GetDebug returns debug flag
func (c *AppConfig) GetDebug() bool {
	return c.Debug
}

// GetVersion returns debug flag
func (c *AppConfig) GetVersion() string {
	return c.Version
}

// GetCommit returns debug flag
func (c *AppConfig) GetCommit() string {
	return c.Commit
}

// GetBuildDate returns debug flag
func (c *AppConfig) GetBuildDate() string {
	return c.BuildDate
}

// GetName returns debug flag
func (c *AppConfig) GetName() string {
	return c.Name
}