refactor(auth): extract supported providers message as constant
Address review comment from @xiaket - the "Supported providers" message was printed in multiple places. Now extracted as a constant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dc9fb327c2
commit
ea447c6b68
1 changed files with 4 additions and 2 deletions
|
|
@ -17,6 +17,8 @@ import (
|
||||||
"github.com/sipeed/picoclaw/pkg/providers"
|
"github.com/sipeed/picoclaw/pkg/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const supportedProvidersMsg = "Supported providers: openai, anthropic, google-antigravity"
|
||||||
|
|
||||||
func authCmd() {
|
func authCmd() {
|
||||||
if len(os.Args) < 3 {
|
if len(os.Args) < 3 {
|
||||||
authHelp()
|
authHelp()
|
||||||
|
|
@ -78,7 +80,7 @@ func authLoginCmd() {
|
||||||
|
|
||||||
if provider == "" {
|
if provider == "" {
|
||||||
fmt.Println("Error: --provider is required")
|
fmt.Println("Error: --provider is required")
|
||||||
fmt.Println("Supported providers: openai, anthropic, google-antigravity")
|
fmt.Println(supportedProvidersMsg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +93,7 @@ func authLoginCmd() {
|
||||||
authLoginGoogleAntigravity()
|
authLoginGoogleAntigravity()
|
||||||
default:
|
default:
|
||||||
fmt.Printf("Unsupported provider: %s\n", provider)
|
fmt.Printf("Unsupported provider: %s\n", provider)
|
||||||
fmt.Println("Supported providers: openai, anthropic, google-antigravity")
|
fmt.Println(supportedProvidersMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue