@@ -36,16 +36,16 @@ def _load_dynamic_commands(self, ctx):
3636 self ._commands_loaded = True
3737
3838
39- def get_variable_type (variable_type : str ) -> click .types :
40- type_mapping = {"str" : click .STRING , "int" : click .INT , "bool" : click .BOOL , "path" : click .Path }
39+ def get_click_variable_type (variable_type : str ) -> click .types :
40+ type_mapping = {"str" : click .STRING , "int" : click .INT , "bool" : click .BOOL , "path" : click .Path () }
4141 return type_mapping .get (variable_type .lower (), None )
4242
4343
4444def create_dynamic_command (config , template : TemplateModel ) -> click .Command :
4545 options = []
4646 for arg in template .variables if template .variables else []:
4747 arg_name = arg .name
48- arg_type = get_variable_type (arg .type )
48+ arg_type = get_click_variable_type (arg .type )
4949 help_text = arg .description or f"{ arg_name } option"
5050 cli_option = arg .cli_option or f"--{ arg_name } "
5151 if cli_option in RESERVED_RUN_TEMPLATE_CLI_OPTIONS :
@@ -59,7 +59,7 @@ def create_dynamic_command(config, template: TemplateModel) -> click.Command:
5959 click .Option ([cli_option ], type = arg_type , default = arg .default , required = arg .required , show_default = True ,
6060 help = help_text ))
6161 elif arg .type .startswith ("list[" ):
62- list_type = get_variable_type (arg .type .split ('[' )[1 ][:- 1 ])
62+ list_type = get_click_variable_type (arg .type .split ('[' )[1 ][:- 1 ])
6363 if not list_type :
6464 raise click .ClickException (f"Failed to parse list type for { arg .name } " )
6565 options .append (
0 commit comments