sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
51 stars 2 forks source link

Hook Alias #236

Open robcxyz opened 8 months ago

robcxyz commented 8 months ago

Hook Alias

Alias hooks so they can be called easier

Overview

Would be nice to be able to define aliases for a hook to make them easier to call. For instance the listdir hook could additionally be called with list_dir or dir_list:


from tackle import BaseHook

class ListDirHook(BaseHook):

    hook_name = 'listdir'

    class Config:

        alias = ['list_dir', 'dir_list']