diff --git a/vultron/cmd.py b/vultron/cmd.py index 8a23364..f99a6cf 100644 --- a/vultron/cmd.py +++ b/vultron/cmd.py @@ -35,12 +35,12 @@ class Command: def __init__(self, prog, api_key, out): self.prog = prog self.out = out - self.uses_api = True + self.needs_api_key = True self.default = "help" self.init() - if self.uses_api and api_key is None: + if self.needs_api_key and api_key is None: raise NoApiKey() self.api = vultron.api.Client(api_key) @@ -55,6 +55,8 @@ class Command: data = fn(*args) + # FIXME: Let functions choose the output format. This will allow help + # functions to still return a rendering. if data is not None: display = vultron.display.FORMATS[self.out](data) print(display.render()) diff --git a/vultron/cmds/help.py b/vultron/cmds/help.py index a005020..8d956cd 100644 --- a/vultron/cmds/help.py +++ b/vultron/cmds/help.py @@ -3,7 +3,7 @@ import vultron.display class Help(vultron.cmd.Command): def init(self): - self.uses_api = False + self.needs_api_key = False def vultron_help(self): print("stub help message here") diff --git a/vultron/cmds/region.py b/vultron/cmds/region.py index 436840e..9887878 100644 --- a/vultron/cmds/region.py +++ b/vultron/cmds/region.py @@ -4,6 +4,9 @@ import vultron.display class Region(vultron.cmd.Command): """Query for information on Vultr regions.""" + def init(self): + self.needs_api_key = False + def vultron_list(self): """Display all available regions."""