Skip to content

Commit 375ccb9

Browse files
committed
feat: goauth: add ReadCredentialsFromCLI()
1 parent 4e0158e commit 375ccb9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

credentials_set.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ func (set *CredentialsSet) Inflate() error {
5252
return nil
5353
}
5454

55+
func ReadCredentialsFromCLI(inclAccountsOnError bool) (Credentials, error) {
56+
if opts, err := ParseOptions(); err != nil {
57+
return Credentials{}, err
58+
} else {
59+
return opts.Credentials()
60+
}
61+
}
62+
5563
func ReadCredentialsFromSetFile(credentialsSetFilename, accountKey string, inclAccountsOnError bool) (Credentials, error) {
5664
set, err := ReadFileCredentialsSet(credentialsSetFilename, true)
5765
if err != nil {

0 commit comments

Comments
 (0)