@@ -80,6 +80,7 @@ def is_str_dict(val: Any) -> TypeGuard[TaskParameters]:
8080 invoke_without_command = True , context_settings = {"auto_envvar_prefix" : "BLUEAPI" }
8181)
8282@click .version_option (version = __version__ , prog_name = "blueapi" )
83+ @click .option ("-H" , "--host" , type = str )
8384@click .option (
8485 "-c" , "--config" , type = Path , help = "Path to configuration YAML file" , multiple = True
8586)
@@ -99,7 +100,10 @@ def is_str_dict(val: Any) -> TypeGuard[TaskParameters]:
99100)
100101@click .pass_context
101102def main (
102- ctx : click .Context , config : tuple [Path , ...], log_level : str | None = None
103+ ctx : click .Context ,
104+ config : tuple [Path , ...],
105+ host : str | None = None ,
106+ log_level : str | None = None ,
103107) -> None :
104108 # if no command is supplied, run with the options passed
105109
@@ -111,7 +115,8 @@ def main(
111115 config_loader .use_values_from_yaml (* config )
112116 except FileNotFoundError as fnfe :
113117 raise ClickException (f"Config file not found: { fnfe .filename } " ) from fnfe
114-
118+ if host :
119+ config_loader .use_values ({"api" : {"url" : host }})
115120 if log_level :
116121 config_loader .use_values ({"logging" : {"level" : log_level }})
117122
0 commit comments