Skip to content

Commit

Permalink
fix: make --confluence-spaces argument a string array (#49)
Browse files Browse the repository at this point in the history
This PR if replacing #46. 

@baruchiro made a PR with a better mechanism to search for only
specified spaces.

Now on this PR I'm just fixing a small issue with that implementation
that is to replace the --confluence-spaces argument from string to
stringArray.

This will fix a issue we got when no spaces selected.
  • Loading branch information
joaopedrocsilva authored Apr 17, 2023
1 parent 919e0a0 commit 11f13a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/confluence.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (p *ConfluencePlugin) GetCredentials() (string, string) {
func (p *ConfluencePlugin) DefineCommandLineArgs(cmd *cobra.Command) error {
flags := cmd.Flags()
flags.StringP(argConfluence, "", "", "scan confluence url")
flags.StringP(argConfluenceSpaces, "", "", "confluence spaces")
flags.StringArray(argConfluenceSpaces, []string{}, "confluence spaces")
flags.StringP(argConfluenceUsername, "", "", "confluence username or email")
flags.StringP(argConfluenceToken, "", "", "confluence token")
flags.BoolP(argConfluenceHistory, "", false, "scan pages history")
Expand All @@ -54,7 +54,7 @@ func (p *ConfluencePlugin) Initialize(cmd *cobra.Command) error {

confluenceUrl = strings.TrimRight(confluenceUrl, "/")

confluenceSpaces, _ := flags.GetString(argConfluenceSpaces)
confluenceSpaces, _ := flags.GetStringArray(argConfluenceSpaces)
confluenceUsername, _ := flags.GetString(argConfluenceUsername)
confluenceToken, _ := flags.GetString(argConfluenceToken)
runHistory, _ := flags.GetBool(argConfluenceHistory)
Expand All @@ -66,7 +66,7 @@ func (p *ConfluencePlugin) Initialize(cmd *cobra.Command) error {
p.Token = confluenceToken
p.Username = confluenceUsername
p.URL = confluenceUrl
p.Spaces = strings.Split(confluenceSpaces, ",")
p.Spaces = confluenceSpaces
p.Enabled = true
p.History = runHistory
return nil
Expand Down

0 comments on commit 11f13a0

Please sign in to comment.