summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Admin/Client.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-09-12 21:25:16 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-09-12 21:25:16 +0000
commit01e56e153fd83c0b51760cf4ec04cc07e39bcc1b (patch)
tree8999bb657bb258d41d83244c0506c43956775512 /src/lib/Server/Admin/Client.py
parentcd78f764f64ea2984c6382a20b7ffd7d44345995 (diff)
downloadbcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.tar.gz
bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.tar.bz2
bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.zip
Improve help messages for bcfg2-admin (and modes)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4910 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Admin/Client.py')
-rw-r--r--src/lib/Server/Admin/Client.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/Server/Admin/Client.py b/src/lib/Server/Admin/Client.py
index 1f784a4f2..a0b24a71b 100644
--- a/src/lib/Server/Admin/Client.py
+++ b/src/lib/Server/Admin/Client.py
@@ -2,20 +2,22 @@ import Bcfg2.Server.Admin
from Bcfg2.Server.Plugins.Metadata import MetadataConsistencyError
class Client(Bcfg2.Server.Admin.MetadataCore):
- __shorthelp__ = 'bcfg2-admin client add <client> attr1=val1 attr2=val2\nbcfg2-admin client del <client>'
- __longhelp__ = __shorthelp__ + '\n\tCreate or delete client entries'
+ __shorthelp__ = "Create or delete client entries"
+ __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin client add <client> "
+ "attr1=val1 attr2=val2\n"
+ "bcfg2-admin client del <client>")
+ __usage__ = ("bcfg2-admin client [options] [add|del] [attr=val]")
+
def __init__(self, configfile):
- Bcfg2.Server.Admin.MetadataCore.__init__(self, configfile)
+ Bcfg2.Server.Admin.MetadataCore.__init__(self, configfile,
+ self.__usage__)
def __call__(self, args):
Bcfg2.Server.Admin.MetadataCore.__call__(self, args)
if len(args) == 0:
- self.errExit("Client mode requires at least one argument: <add> or <delete>")
- if "-h" in args:
- print "Usage: "
- print self.__shorthelp__
- raise SystemExit(1)
- if args[0] == 'add':
+ self.errExit("No argument specified.\n"
+ "Please see bcfg2-admin client help for usage.")
+ if args[0] == 'add':
attr_d = {}
for i in args[2:]:
attr, val = i.split('=', 1)