From 78d5ee44541d946208821646526857a400da005f Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Sat, 12 Jul 2008 00:33:29 +0000 Subject: Add option and error handling git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4778 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Reports.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Admin/Reports.py b/src/lib/Server/Admin/Reports.py index cafc61e2d..22a3d3031 100644 --- a/src/lib/Server/Admin/Reports.py +++ b/src/lib/Server/Admin/Reports.py @@ -94,8 +94,13 @@ class Reports(Bcfg2.Server.Admin.Mode): c_list = Client.objects.all() result = list() - - opts, pargs = getopt(args, 'cd', ['sort=', 'fields=']) + + try: + opts, pargs = getopt(args, 'cdx:', ['sort=', 'fields=']) + except: + print "error" + print self.__shorthelp__ + raise SystemExit(1) for option in opts: if len(option) > 0: -- cgit v1.2.3-1-g7c22