@@ -25,8 +25,6 @@ func init() {
2525 profileCmd .AddCommand (profileSetEndpointCmd )
2626
2727 profileSetEndpointCmd .Flags ().String ("api-endpoint" , "" , "Override API endpoint" )
28- profileSetEndpointCmd .Flags ().String ("quotes-endpoint" , "" , "Override Quotes API endpoint (data-api)" )
29- profileSetEndpointCmd .Flags ().String ("events-endpoint" , "" , "Override Events API endpoint" )
3028}
3129
3230var profileListCmd = & cobra.Command {
@@ -130,21 +128,17 @@ var profileLogoutCmd = &cobra.Command{
130128
131129var profileSetEndpointCmd = & cobra.Command {
132130 Use : "set-endpoint" ,
133- Short : "Set custom endpoint overrides for the active profile" ,
134- Long : `Set custom API/Data/Events endpoint overrides for the active profile.
135- Only specified endpoints are updated; others remain unchanged.
131+ Short : "Set custom endpoint override for the active profile" ,
132+ Long : `Set custom API endpoint override for the active profile.
136133
137134Examples:
138135 webull profile set-endpoint --api-endpoint us-openapi-alb.uat.webullbroker.com
139- webull profile set-endpoint --data-endpoint us-data-api.uat.webullbroker.com
140- webull profile set-endpoint --api-endpoint api.webull.com --data-endpoint data-api.webull.com` ,
136+ webull profile set-endpoint --api-endpoint api.webull.com` ,
141137 RunE : func (cmd * cobra.Command , args []string ) error {
142138 apiEp , _ := cmd .Flags ().GetString ("api-endpoint" )
143- quotesEp , _ := cmd .Flags ().GetString ("quotes-endpoint" )
144- eventsEp , _ := cmd .Flags ().GetString ("events-endpoint" )
145139
146- if apiEp == "" && quotesEp == "" && eventsEp == "" {
147- output .PrintError ("MISSING_PARAMETER" , "at least one of --api-endpoint, --quotes-endpoint, --events -endpoint is required" , 0 )
140+ if apiEp == "" {
141+ output .PrintError ("MISSING_PARAMETER" , "--api-endpoint is required" , 0 )
148142 return fmt .Errorf ("no endpoint specified" )
149143 }
150144
@@ -164,32 +158,15 @@ Examples:
164158 return fmt .Errorf ("active profile %q not found" , cfg .ActiveProfile )
165159 }
166160
167- // Incremental update: only override specified endpoints
168- if apiEp != "" {
169- profile .Endpoints .API = apiEp
170- }
171- if quotesEp != "" {
172- profile .Endpoints .Quotes = quotesEp
173- }
174- if eventsEp != "" {
175- profile .Endpoints .Events = eventsEp
176- }
161+ profile .Endpoints .API = apiEp
177162
178163 if err := pm .Save (cfg ); err != nil {
179164 return err
180165 }
181166
182167 if ! flagQuiet {
183- fmt .Fprintf (os .Stderr , "✓ Endpoints updated for profile %q\n " , profile .Name )
184- if apiEp != "" {
185- fmt .Fprintf (os .Stderr , " api: %s\n " , apiEp )
186- }
187- if quotesEp != "" {
188- fmt .Fprintf (os .Stderr , " quotes-api: %s\n " , quotesEp )
189- }
190- if eventsEp != "" {
191- fmt .Fprintf (os .Stderr , " events-api: %s\n " , eventsEp )
192- }
168+ fmt .Fprintf (os .Stderr , "✓ Endpoint updated for profile %q\n " , profile .Name )
169+ fmt .Fprintf (os .Stderr , " api: %s\n " , apiEp )
193170 }
194171 return nil
195172 },
0 commit comments