style: make flag parsing more readable

This commit is contained in:
Simon Cornet 2025-03-05 10:48:46 +01:00
commit 10a6ed6df3

View file

@ -11,12 +11,35 @@ import (
func manageArguments() {
// configuration vars
var archivedFlag = flag.String("archived", "excluded", "To include archived repositories (any|excluded|exclusive)\n example: -archived=any\nenv = GOGITLABBER_ARCHIVED\n")
var concurrencyFlag = flag.Int("concurrency", 15, "Specify repository concurrency\n example: -concurrency=15\nenv = GOGITLABBER_CONCURRENCY\n")
var destinationFlag = flag.String("destination", "$HOME/Documents", "Specify where to check the repositories out\n example: -destination=$HOME/repos\nenv = GOGITLABBER_DESTINATION\n")
var hostFlag = flag.String("gitlab-url", "gitlab.com", "Specify GitLab host\n example: -gitlab-url=gitlab.com\nenv = GITLAB_URL\n")
var tokenFlag = flag.String("gitlab-api-token", "", "Specify GitLab API token\n example: -gitlab-api=glpat-xxxx\nenv = GITLAB_API_TOKEN\n")
var debugFlag = flag.Bool("debug", false, "Toggle debug mode\n example: -debug=true\nenv = GOGITLABBER_DEBUG\n")
var archivedFlag = flag.String(
"archived",
"excluded",
"To include archived repositories (any|excluded|exclusive)\n example: -archived=any\nenv = GOGITLABBER_ARCHIVED\n")
var concurrencyFlag = flag.Int(
"concurrency",
15,
"Specify repository concurrency\n example: -concurrency=15\nenv = GOGITLABBER_CONCURRENCY\n")
var destinationFlag = flag.String(
"destination",
"$HOME/Documents",
"Specify where to check the repositories out\n example: -destination=$HOME/repos\nenv = GOGITLABBER_DESTINATION\n")
var hostFlag = flag.String(
"gitlab-url",
"gitlab.com",
"Specify GitLab host\n example: -gitlab-url=gitlab.com\nenv = GITLAB_URL\n")
var tokenFlag = flag.String(
"gitlab-api-token",
"",
"Specify GitLab API token\n example: -gitlab-api=glpat-xxxx\nenv = GITLAB_API_TOKEN\n")
var debugFlag = flag.Bool(
"debug",
false,
"Toggle debug mode\n example: -debug=true\nenv = GOGITLABBER_DEBUG\n")
flag.Parse()