piccolo-orm / targ

Python CLI using type hints and docstrings.
https://targ.readthedocs.io/en/latest/index.html
MIT License
20 stars 2 forks source link

Aliases #4

Closed dantownsend closed 3 years ago

dantownsend commented 3 years ago

Aliases can now be provided for commands. Examples are abbreviations or misspellings.

from targ import CLI

def add(a: int, b: int):
    print(a + b)

if __name__ == "__main__":
    cli = CLI()
    cli.register(add, aliases=['+', 'sum'])
    cli.run()