vultron/vultron/cmds/help.py

33 lines
668 B
Python

import os
import vultron.cmd
class Help(vultron.cmd.Command):
"""This help message."""
def init(self):
self.needs_api_key = False
def vultron_help(self):
"""This help message."""
prog = os.path.basename(self.prog)
cmds = vultron.cmd.Command.__subclasses__()
print(f"usage: {prog} [options] <cmd>")
print()
print("About:")
print("High-vultage API client for the vultrtual cloud.")
print()
# FIXME: print global options here
print("Commands:")
for cmd in cmds:
name = cmd.__name__.lower()
if cmd.__doc__ is None:
print(f"\t{name}")
else:
print(f"\t{name} - {cmd.__doc__}")