Skip to content

Commit

Permalink
allow apic, usr, pwd from environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
brightpuddle committed Mar 7, 2024
1 parent 5ed5149 commit ecae291
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/collector/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func input(prompt string) string {

// Args are command line parameters.
type Args struct {
APIC string `arg:"-a" help:"APIC hostname or IP address"`
Username string `arg:"-u" help:"APIC username"`
Password string `arg:"-p" help:"APIC password"`
APIC string `arg:"-a,env:ACI_URL" help:"APIC hostname or IP address"`
Username string `arg:"-u,env:ACI_USERNAME" help:"APIC username"`
Password string `arg:"-p,env:ACI_PASSWORD" help:"APIC password"`
Output string `arg:"-o" help:"Output file"`
RequestRetryCount int `arg:"--request-retry-count" help:"Times to retry a failed request" default:"3"`
RetryDelay int `arg:"--retry-delay" help:"Seconds to wait before retry" default:"10"`
Expand Down Expand Up @@ -65,5 +65,6 @@ func newArgs() Args {
args.Password = string(pwd)
fmt.Println()
}
fmt.Println(args.Password)
return args
}

0 comments on commit ecae291

Please sign in to comment.