change linux
This commit is contained in:
+40
-1
@@ -39,7 +39,10 @@ type ListCmdConfig struct {
|
||||
GitFlag bool
|
||||
TeaFlag bool
|
||||
User string
|
||||
UserFlag bool
|
||||
listOrganizationFlag bool
|
||||
GitHubSearchFlag bool
|
||||
GitHubSearch string
|
||||
}
|
||||
|
||||
type CreateCmdConfig struct {
|
||||
@@ -295,6 +298,36 @@ func (c *Config) SetListUser(value string) {
|
||||
c.ListCmd.User = value
|
||||
}
|
||||
|
||||
// getter for ListUserFlag
|
||||
func (c *Config) GetListUserFlag() bool {
|
||||
return c.ListCmd.UserFlag
|
||||
}
|
||||
|
||||
// setter for ListUserFlag
|
||||
func (c *Config) SetListUserFlag(value bool) {
|
||||
c.ListCmd.UserFlag = value
|
||||
}
|
||||
|
||||
// getter for GitHubSearchFlag
|
||||
func (c *Config) GetGitHubSearchFlag() bool {
|
||||
return c.ListCmd.GitHubSearchFlag
|
||||
}
|
||||
|
||||
// setter for GitHubSearchFlag
|
||||
func (c *Config) SetGitHubSearchFlag(value bool) {
|
||||
c.ListCmd.GitHubSearchFlag = value
|
||||
}
|
||||
|
||||
// getter for GitHubSearch
|
||||
func (c *Config) GetGitHubSearch() string {
|
||||
return c.ListCmd.GitHubSearch
|
||||
}
|
||||
|
||||
// setter for GitHubSearch
|
||||
func (c *Config) SetGitHubSearch(value string) {
|
||||
c.ListCmd.GitHubSearch = value
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * C R E A T E C M D GETTER - SETTER * * * *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@@ -537,7 +570,7 @@ func (c *Config) Init() {
|
||||
|
||||
// set Gitea token from environment variable
|
||||
var giteaTokenEnv string = utils.GetEnvVarValueFromOsEnv("GITEA_TOKEN")
|
||||
c.SetGithubTokenEnv(giteaTokenEnv)
|
||||
c.SetGitTeaTokenEnv(giteaTokenEnv)
|
||||
|
||||
// set verbose flag
|
||||
c.SetVerboseFlag(false)
|
||||
@@ -618,6 +651,7 @@ func (c *Config) InitCmdList(cmd *cobra.Command, args []string) {
|
||||
|
||||
if cmd.Flags().Changed("user") || cmd.Flags().Changed("u") {
|
||||
c.SetListUser(cmd.Flag("user").Value.String())
|
||||
c.SetListUserFlag(true)
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("git") || cmd.Flags().Changed("g") {
|
||||
@@ -628,6 +662,11 @@ func (c *Config) InitCmdList(cmd *cobra.Command, args []string) {
|
||||
c.SetTeaFlag(true)
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("search") || cmd.Flags().Changed("s") {
|
||||
c.SetGitHubSearchFlag(true)
|
||||
c.SetGitHubSearch(cmd.Flag("search").Value.String())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Reference in New Issue
Block a user