make some correction

This commit is contained in:
2023-11-29 12:57:49 -05:00
parent 70c9e72753
commit 8000ff69c9
11 changed files with 948 additions and 65 deletions
+43 -18
View File
@@ -68,6 +68,9 @@ type EnvCmdConfig struct {
EnvVariablesCategory string
EnvVariablesSetFlag bool
EnvVariablesShowAllFlag bool
EnvVariablesKey string
EnvVariablesValue string
EnvVariablesDeleteFlag bool
}
// * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -104,24 +107,9 @@ func (c *Config) SetAuthor(value string) {
c.author = value
}
<<<<<<< HEAD
// Getter for modifDate field
func (c *Config) GetModifDate() string {
return c.ModifDate
=======
func GetEnvVariablesFlag() bool {
return envVariablesFlag
}
func SetEnvVariablesFlag(flag bool) {
envVariablesFlag = flag
}
// functions for list command
// --------------------------
func SetListOrganisation(name string) {
listOrganization = name
>>>>>>> b7ba427 (corr. envVar)
}
// Setter for modifDate field
@@ -561,6 +549,36 @@ func (c *Config) SetEnvShowAllFlag(value bool) {
c.EnvCmd.EnvVariablesShowAllFlag = value
}
// Getter for env Key
func (c *Config) GetEnvKey() string {
return c.EnvCmd.EnvVariablesKey
}
// Setter for env Key
func (c *Config) SetEnvKey(value string) {
c.EnvCmd.EnvVariablesKey = value
}
// Getter for env Value
func (c *Config) GetEnvValue() string {
return c.EnvCmd.EnvVariablesValue
}
// Setter for env Value
func (c *Config) SetEnvValue(value string) {
c.EnvCmd.EnvVariablesValue = value
}
// Getter for env Delete flag
func (c *Config) GetEnvDeleteFlag() bool {
return c.EnvCmd.EnvVariablesDeleteFlag
}
// Setter for env Delete flag
func (c *Config) SetEnvDeleteFlag(value bool) {
c.EnvCmd.EnvVariablesDeleteFlag = value
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// initialize basic configuration
// * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -580,11 +598,11 @@ func (c *Config) Init() {
c.SetConfigFileYmlName(configFileYmlName)
// set Github token from environment variable
var githubTokenEnv string = utils.GetEnvVarValueFromOsEnv("GITHUB_TOKEN")
var githubTokenEnv string = utils.GetGitTokenFromOsEnv()
c.SetGithubTokenEnv(githubTokenEnv)
// set Gitea token from environment variable
var giteaTokenEnv string = utils.GetEnvVarValueFromOsEnv("GITEA_TOKEN")
var giteaTokenEnv string = utils.GetGitTeaTokenFromOsEnv()
c.SetGitTeaTokenEnv(giteaTokenEnv)
// set verbose flag
@@ -599,6 +617,9 @@ func (c *Config) Init() {
// set help flag
c.SetHelpFlag(false)
// set delete flag
c.SetEnvDeleteFlag(false)
// set url base
var urlBase string = "https://git.bcmaison.cf"
c.SetUrlBase(urlBase)
@@ -829,7 +850,7 @@ func (c *Config) DebugPrintString(str string) {
func (c *Config) printAllConfiguration() {
fmt.Println("General Configuration:")
fmt.Println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -")
fmt.Println("- - - - - - - - - - - - - - - GIT_TOKEN- - - - - - - - - - - - - - -")
fmt.Println("Config: DebugMode: ", c.GetDebugMode())
fmt.Println("Config: LogLevel: ", c.GetLogLevel())
fmt.Println("config: Author: ", c.GetAuthor())
@@ -874,6 +895,10 @@ func (c *Config) printAllConfiguration() {
fmt.Println("config: EnvVariablesCategoryFlag: ", c.GetEnvCategoryFlag())
fmt.Println("config: EnvVariablesCategory: ", c.GetEnvCategoryInfo())
fmt.Println("config: EnvVariablesSetFlag: ", c.GetEnvSetFlag())
fmt.Println("config: EnvVariablesShowAllFlag: ", c.GetEnvShowAllFlag())
fmt.Println("config: EnvVariablesKey: ", c.GetEnvKey())
fmt.Println("config: EnvVariablesValue: ", c.GetEnvValue())
fmt.Println("config: EnvVariablesDeleteFlag: ", c.GetEnvDeleteFlag())
fmt.Println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -")
}