Index: /issm/trunk/src/m/utils/Nightly/nightlyrun.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 2166)
+++ /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 2167)
@@ -21,23 +21,12 @@
 global ISSM_DIR
 
-%check number of inputs
-if nargin==0,
-	packages={'macayeal','ice','cielo_serial','cielo_parallel'};
-	rank=1;
-	numprocs=1;
-elseif nargin==1,
-	packages=varargin{1};
-	rank=1;
-	numprocs=1;
-elseif nargin==3,
-	packages=varargin{1};
-	rank=varargin{end-1};
-	numprocs=varargin{end};
-	if ~isnumeric(rank), rank=1; end
-	if ~isnumeric(numprocs), numprocs=1; end
-else
-	help nightlyrun
-	error('nightlyrun error message: bad usage');
-end
+%recover options
+options=recover_options(varargin{:});
+
+%check numproc and rank options
+rank=find_option(options,'rank');
+if isempty(rank), rank=1; end
+rank=find_option(options,'numproc');
+if isempty(rank), numproc=1; end
 
 %Go to Test directory
@@ -49,15 +38,9 @@
 list=listfilesparallel(rank,numprocs);
 
-%Go through list of decks, and run the deck runme.m files package by package.
-for i=1:length(packages),
-	for j=1:numel(list),
-		eval(['cd ' list{j}]);
-		if nargin==2,
-			runme(packages(i),varargin{2});
-		else
-			updatearchive
-		end
-		cd ..
-	end
+%Go through list of decks, and run the deck runme.m files
+for j=1:numel(list),
+	eval(['cd ' list{j}]);
+	runme(varargin{:});
+	cd ..
 end
 
