Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/commands/util/usercount/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
gitLabGroupsFlagUsage = "List of groups(organizations) to scan for contributors"
gitLabAPIURL = "https://gitlab.com"
gitLabTooManyGroupsAndProjects = "Projects and Groups both cannot be provided at the same time."
missingGroupsOrProjects = "Provide at least one group or project"
gitLabBot = "bot"
repoAccessLevelDisabled = "disabled"
repoAccessLevelPrivate = "private"
Expand Down Expand Up @@ -50,6 +51,9 @@ func newUserCountGitLabCommand(gitLabWrapper wrappers.GitLabWrapper) *cobra.Comm
}

func preRunGitLabUserCount(*cobra.Command, []string) error {
if len(gitLabProjects) == 0 && len(gitLabGroups) == 0 {
return errors.New(missingGroupsOrProjects)
}
if len(gitLabProjects) > 0 && len(gitLabGroups) > 0 {
return errors.New(gitLabTooManyGroupsAndProjects)
}
Expand Down
Loading