Skip to content

Commit 311c553

Browse files
authored
split arg init and arg parse, fix init order (#95)
1 parent 881f0f7 commit 311c553

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ var (
3636
)
3737

3838
func main() {
39-
initLogger()
4039
initArgparser()
40+
initLogger()
41+
parseArguments()
4142

4243
logger.Infof("starting azure-devops-exporter v%s (%s; %s; by %v)", gitTag, gitCommit, runtime.Version(), Author)
4344
logger.Info(string(opts.GetJson()))
@@ -70,7 +71,10 @@ func initArgparser() {
7071
os.Exit(1)
7172
}
7273
}
74+
}
7375

76+
// parses and validates the arguments
77+
func parseArguments() {
7478
// load accesstoken from file
7579
if opts.AzureDevops.AccessTokenFile != nil && len(*opts.AzureDevops.AccessTokenFile) > 0 {
7680
logger.Infof("reading access token from file \"%s\"", *opts.AzureDevops.AccessTokenFile)

0 commit comments

Comments
 (0)