summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-16 15:24:33 -0400
committerJim Meyering <jim@meyering.net>2006-10-16 15:24:33 -0400
commitdc989463760d19c1e0ad41c0b6317f9753b93ac3 (patch)
treec13a74df332aea4b6f9dd36a5497c5cf5160007c /cobbler
parentcd25b94d8ef552abed683c5e29a8bde1102f492b (diff)
downloadthird_party-cobbler-dc989463760d19c1e0ad41c0b6317f9753b93ac3.tar.gz
third_party-cobbler-dc989463760d19c1e0ad41c0b6317f9753b93ac3.tar.xz
third_party-cobbler-dc989463760d19c1e0ad41c0b6317f9753b93ac3.zip
Finally added a "usage" function to the CLI.
Minor manpage cleanup.
Diffstat (limited to 'cobbler')
-rwxr-xr-xcobbler/cobbler.py5
-rw-r--r--cobbler/cobbler_msg.py35
2 files changed, 35 insertions, 5 deletions
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index 82d6a14..b6d082d 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -81,7 +81,7 @@ class BootCLI:
"""
Print out abbreviated help if user gives bad syntax
"""
- raise cexceptions.CobblerException("usage")
+ print cobbler_msg.USAGE
def list(self,args):
all = [ self.api.settings(), self.api.distros(),
@@ -260,7 +260,8 @@ class BootCLI:
feed it the remaining args[1:-1] as arguments.
"""
if args is None or len(args) == 0:
- raise cexceptions.CobblerException("help")
+ print cobbler_msg.USAGE
+ return True
if args[0] in commands:
commands[args[0]](args[1:])
else:
diff --git a/cobbler/cobbler_msg.py b/cobbler/cobbler_msg.py
index 5f9ea91..d9d904d 100644
--- a/cobbler/cobbler_msg.py
+++ b/cobbler/cobbler_msg.py
@@ -1,3 +1,5 @@
+# -*- coding: iso-8859-15 -*-
+
"""
Messages used by cobbler.
This module encapsulates strings so they can
@@ -14,6 +16,35 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
+USAGE = """cobbler provisioning tool
+basic usage guide / see "man cobbler" for more.
+
+cobbler check
+
+cobbler distro add --name=<string> --kernel=<path> --initrd=<path>
+ [--kopts=<string>] [--ksmeta=<string>] [--arch=<x86|x86_64|ia64>]
+
+cobbler profile add --name=<string --distro=<string>
+ [--kick-start=<url>] [--kopts=<string>] [--ksmeta=<string>]
+ [--xen-name=<string>] [--xen-file-size=<gigabytes>]
+ [--xen-ram=<megabytes>]
+
+cobbler system add --name=<ip│mac│hostname|default> --profile=<string>
+ [--pxe-address=<string>]
+ [--ksmeta=<string>]
+
+cobbler import --mirror=rsync://<address> --mirror-name=<string>
+cobbler import --path=<path>
+
+cobbler [distro|profile|system] remove --name=<name>
+
+cobbler list
+
+cobbler sync
+
+cobbler system enchant --name=<string> [--password=<string>]
+"""
+
_msg_table = {
"system" : "System",
"profile" : "Profile",
@@ -35,7 +66,6 @@ _msg_table = {
"weird_arg" : "this command doesn't take a parameter named '%s'",
"bad_sys_name" : "system name must be a MAC, IP, or resolveable host",
"bad_ip" : "argument must be an IP address",
- "usage" : "for help, see 'man cobbler'",
"need_to_fix" : "the following potential problems were detected:",
"need_perms" : "cobbler could not access %s",
"need_perms2" : "cobbler could not copy %s to %s",
@@ -91,8 +121,7 @@ No setup problems found.
Manual review and editing of /var/lib/cobbler/settings is recommended to tailor cobbler to your particular configuration.
Good luck.
-""",
- "help" : "see 'man cobbler'"
+"""
}
def lookup(key):