summaryrefslogtreecommitdiffstats
path: root/cobbler/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'cobbler/commands.py')
-rw-r--r--cobbler/commands.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/cobbler/commands.py b/cobbler/commands.py
index 380f374c..98a3a3a7 100644
--- a/cobbler/commands.py
+++ b/cobbler/commands.py
@@ -59,8 +59,14 @@ class FunctionLoader:
# if no args given, show all loaded fns
if len(args) == 1:
return self.show_options()
+
called_name = args[1].lower()
+ # if -v or --version, make it work
+ if called_name in [ "--version", "-v" ]:
+ called_name = "version"
+ args = [ "/usr/bin/cobbler", "version" ]
+
# also show avail options if command name is bogus
if len(args) == 2 and not called_name in self.functions.keys():
@@ -161,8 +167,8 @@ class FunctionLoader:
Prints out all loaded functions.
"""
- print "commands:"
- print "========="
+ print "commands: (use --help on a subcommand for usage)"
+ print "========"
names = self.functions.keys()
names.sort()
@@ -254,7 +260,7 @@ class CobblerFunction:
print "usage:"
print "======"
for x in subs:
- print "cobbler %s %s [ARGS|--help]" % (self.command_name(), x)
+ print "cobbler %s %s [ARGS]" % (self.command_name(), x)
return True
(self.options, self.args) = p.parse_args(args)
return True