diff options
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index a5044ff..c053a38 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -53,6 +53,7 @@ def register_custom_action( cls_names: Union[str, Tuple[str, ...]], mandatory: Tuple[str, ...] = tuple(), optional: Tuple[str, ...] = tuple(), + custom_action: Optional[str] = None, ) -> Callable[[__F], __F]: def wrap(f: __F) -> __F: @functools.wraps(f) @@ -74,7 +75,7 @@ def register_custom_action( if final_name not in custom_actions: custom_actions[final_name] = {} - action = f.__name__.replace("_", "-") + action = custom_action or f.__name__.replace("_", "-") custom_actions[final_name][action] = (mandatory, optional, in_obj) return cast(__F, wrapped_f) |