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 Access Modifiers #235

Open robcxyz opened 8 months ago

robcxyz commented 8 months ago

Hook Access Modifiers

Make hooks either public or private allowing distinction for what is in tackle <target> help.

Overview

Hooks right now are all in the same namespace but if they are to be used as interfaces / rendered into help, they need to be namespaced in a way that allows collections of hooks to be exposed and others to remain hidden. The natural way to do this would be in allowing hooks with different signs to play a role in different

Examples


private_hook<_:

  stuff: things

public_hook<-:

  stuff: things

Help screen with default hook -> tackle --help:


Help: default help  

Args:

  public_hook - help...

  default_hook_method - help...

Flags:

  default_hook_arg - (str) - help...

<-:

  help: A thing that does stuff

  default_hook_arg: str

  default_method<-:

    param: str

base-method<-:

  param: Foo

base<_:

  base-param: str

<-:

  extends: base

  help: A thing that does stuff

  default_hook_arg: str

  default_method<-:

    param: str

base-method<-:

  extends: base

  param: Foo

Implementation