From 86c9735e844ab75ecdd032bab7415c1bf9ac3271 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Fri, 06 Jan 2017 23:00:14 +0000
Subject: [PATCH] Fixes in analyses.

---
 trisurf/tsmgr.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/trisurf/tsmgr.py b/trisurf/tsmgr.py
index 435828d..ffe9278 100644
--- a/trisurf/tsmgr.py
+++ b/trisurf/tsmgr.py
@@ -40,7 +40,7 @@
 			    help='process number at host. If hostname is not specified, localhost is assumed. If no processes are specified all processes on all hosts are assumed.')
 	action_group=parser.add_mutually_exclusive_group(required=True)
 	action_group.add_argument('-c','--comment',nargs=1, help='append comment to current comment')
-	action_group.add_argument('--analysis', nargs='*', help='runs analysis function defined in configuration file')
+	action_group.add_argument('--analysis', nargs='+', help='runs analysis function defined in configuration file')
 	action_group.add_argument('--delete-comment', help='delete comment',action='store_true')
 	action_group.add_argument('-k','--kill','--stop','--suspend', help='stop/kill the process', action='store_true')
 	action_group.add_argument('-r','--run','--start','--continue', help='start/continue process', action='store_true')
@@ -188,6 +188,9 @@
 
 
 def analyze(args,host,a_dict, analysis):
+	if len(a_dict)==0:
+		print ('Error: no analyses are specified in the tsmgr.start()!')
+		exit(1)
 	target_runs=getTargetRunIdxList(args)
 	if target_runs==None:
 		target_runs=list(range(1,len(host['runs'])+1))
@@ -250,14 +253,12 @@
 def start(hosts,argv=sys.argv[1:], analyses={}):
 	args=vars(ParseCLIArguments(argv))
 	#print(vars(args))
-
 	#Backward compatibility... If running just on localmode, the host specification is unnecessary. Check if only Runs are specified
 	try:
 		test_host=hosts[0]['name']
 	except:
 		print("Old syntax detected.")
 		hosts=({'name':socket.gethostname(),'address':'127.0.0.1', 'runs':hosts},)
-
 
 	#find the host at which the action is attended
 	if args['host']==None:

--
Gitblit v1.9.3