style: make flag parsing more readable
This commit is contained in:
parent
7b5cb295ff
commit
10a6ed6df3
1 changed files with 29 additions and 6 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue