Implement a useful global help message
This commit is contained in:
parent
63607e3d93
commit
793971b154
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import vultron.cmd
|
import vultron.cmd
|
||||||
import vultron.display
|
import vultron.display
|
||||||
|
|
||||||
|
@ -6,4 +7,25 @@ class Help(vultron.cmd.Command):
|
||||||
self.needs_api_key = False
|
self.needs_api_key = False
|
||||||
|
|
||||||
def vultron_help(self):
|
def vultron_help(self):
|
||||||
print("stub help message here")
|
"""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__}")
|
||||||
|
|
Loading…
Reference in New Issue