summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Admin/Query.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/Query.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/Query.py')
-rw-r--r--src/lib/Server/Admin/Query.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/Server/Admin/Query.py b/src/lib/Server/Admin/Query.py
index 296749cf7..6df7021e5 100644
--- a/src/lib/Server/Admin/Query.py
+++ b/src/lib/Server/Admin/Query.py
@@ -1,8 +1,20 @@
import Bcfg2.Server.Admin, Bcfg2.Logger, logging
class Query(Bcfg2.Server.Admin.Mode):
- __shorthelp__ = 'bcfg2-admin query [-n] [-c] [-f filename] g=group p=profile'
- __longhelp__ = __shorthelp__ + '\n\tQuery clients'
+ __shorthelp__ = "Query clients"
+ __longhelp__ = (__shorthelp__ + "\nbcfg2-admin query [-n] [-c] "
+ "[-f filename] g=group p=profile")
+ __usage__ = ("bcfg2-admin query [options] <g=group> <p=profile>\n\n"
+ " %-25s%s\n"
+ " %-25s%s\n"
+ " %-25s%s\n" %
+ ("-n",
+ "query results delimited with newlines",
+ "-c",
+ "query results delimited with commas",
+ "-f filename",
+ "write query to file"))
+
def __init__(self, cfile):
logging.root.setLevel(100)
Bcfg2.Logger.setup_logging(100, to_console=False, to_syslog=False)
@@ -39,9 +51,9 @@ class Query(Bcfg2.Server.Admin.Mode):
print "Unknown argument %s" % arg
continue
if k == 'p':
- nc = self.meta.GetClientByProfile(v)
+ nc = self.meta.GetClientByProfile(v)
elif k == 'g':
- nc = self.meta.GetClientByGroup(v)
+ nc = self.meta.GetClientByGroup(v)
clients = [c for c in clients if c in nc]
if '-n' in args:
for client in clients: