1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-09-22 04:25:55 -04:00
toot/cli.py
Ivan Habunek bebd8e9023
wip
2023-06-26 14:55:27 +02:00

17 lines
363 B
Python

import click
from pkg_resources import iter_entry_points
[entry_point] = list(iter_entry_points('console_scripts', name="toot"))
cli = entry_point.resolve()
print(cli)
ctx = click.Context(cli)
commands = getattr(cli, 'commands', {})
print(ctx)
command: click.Command
for name, command in cli.commands.items():
print(name, command)
print(command.help)