@@ -94,7 +94,9 @@ def prompt_with_default(prompt_text, default="", hide_input=False, required=Fals
9494 return default
9595 if required :
9696 # Cannot fulfill required argument without default in non-interactive mode
97- raise click .Abort ()
97+ raise click .UsageError (
98+ "A required value has no default and cannot be prompted in non-interactive mode."
99+ )
98100 return ""
99101
100102 # if default:
@@ -174,7 +176,7 @@ def install(server_name, force=False, alias=None):
174176
175177 # Confirm addition
176178 alias_text = f" as '{ alias } '" if alias else ""
177- if not force and not should_force_operation () and not Confirm .ask (f"Install this server to global configuration{ alias_text } ?" ):
179+ if not should_force_operation (force ) and not Confirm .ask (f"Install this server to global configuration{ alias_text } ?" ):
178180 console .print ("[yellow]Operation cancelled.[/]" )
179181 return
180182
@@ -219,7 +221,7 @@ def install(server_name, force=False, alias=None):
219221 selected_method = installations [method_id ]
220222
221223 # If multiple methods are available and not forced, offer selection
222- if len (installations ) > 1 and not force and not should_force_operation ():
224+ if len (installations ) > 1 and not should_force_operation (force ):
223225 console .print ("\n [bold]Available installation methods:[/]" )
224226 methods_list = []
225227
@@ -439,7 +441,7 @@ def install(server_name, force=False, alias=None):
439441 )
440442
441443 # Add server to global configuration
442- success = global_add_server (full_server_config .to_server_config (), force or should_force_operation ())
444+ success = global_add_server (full_server_config .to_server_config (), should_force_operation (force ))
443445
444446 if success :
445447 # Server has been successfully added to the global configuration
0 commit comments