diff --git a/map2map/main.py b/map2map/main.py index 03a10cb..63782f0 100644 --- a/map2map/main.py +++ b/map2map/main.py @@ -28,6 +28,18 @@ def _int_tuple(value): return t class VariadicType(click.ParamType): + """ + A custom parameter type for Click command-line interface. + + This class provides a way to define custom parameter types for Click commands. + It supports various types such as string, integer, float, JSON, and file paths. + + Args: + typename (str or dict): The name of the type or a dictionary specifying the type and options. + + Raises: + ValueError: If the typename is not recognized. + """ _mapper = { "str_list": {"type": "string_list", "func": _str_list}, @@ -58,7 +70,6 @@ class VariadicType(click.ParamType): except Exception as e: self.fail(f"Could not parse {self._typename}: {e}", param, ctx) - def _apply_options(options_file, f): common_args = yaml.load(_load_resource_file(options_file), Loader=Loader) common_args = common_args['arguments']