[Swift-commit] r7295 - trunk/bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon Nov 18 13:36:12 CST 2013


Author: davidk
Date: 2013-11-18 13:36:12 -0600 (Mon, 18 Nov 2013)
New Revision: 7295

Modified:
   trunk/bin/swift
   trunk/bin/swiftrun
Log:
Don't create a run directory if -version or -help is specified


Modified: trunk/bin/swift
===================================================================
--- trunk/bin/swift	2013-11-18 18:25:32 UTC (rev 7294)
+++ trunk/bin/swift	2013-11-18 19:36:12 UTC (rev 7295)
@@ -171,7 +171,7 @@
 	$BASH -c "echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1 > /dev/udp/$LISTENER/$PORT" > /dev/null 2>&1 &
 fi
 
-mv *.d/ $( ls -1rtd run*/ |tail -1 ) > /dev/null 2>&1
+mv *.d/ $( ls -1rtd run*/ 2>/dev/null |tail -1 ) > /dev/null 2>&1
 rm *.swiftx *.kml > /dev/null 2>&1
 exit $return_code
 

Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun	2013-11-18 18:25:32 UTC (rev 7294)
+++ trunk/bin/swiftrun	2013-11-18 19:36:12 UTC (rev 7295)
@@ -18,13 +18,15 @@
 my $option_siteslist;		# Value of -sites option, comma separated
 my $option_config;		# Value of -config option
 my $option_listconfig; 		# List configuration files used, values, then exit
+my $option_help;                # Print help
+my $option_version;             # Print version number
 my @sites;			# List of sites from -sites in array
 my $run_directory;		# Run directory to be created, run.NNNN
 my @new_swift_args;		# New command line arguments
 my @original_swift_args;	# Original arguments
 
 
-# List of xml shortcuts. Keep in lower case.
+# List of xml shortcuts
 my %xml_aliases = (
                    'allocationstepsize'        => 'globus.allocationstepsize',
                    'delaybase'                 => 'karajan.delaybase',
@@ -163,11 +165,13 @@
 @original_swift_args = @ARGV;
 GetOptionsFromArray(
            \@original_swift_args, 
+           'config=s'        => \$option_config,
+           'help'            => \$option_help,
+           'listconfig'      => \$option_listconfig,
+           'site|sites=s'    => \$option_siteslist,
            'sitesfile=s'     => \$option_sitesfile,
            'tcfile=s'        => \$option_tcfile,
-           'config=s'        => \$option_config,
-           'site|sites=s'    => \$option_siteslist,
-           'listconfig'       => \$option_listconfig,
+           'version'         => \$option_version,
 );
 
 # Set @sites array from comma separated list of sites
@@ -231,6 +235,15 @@
    exit;
 }
 
+# If -version or -help is specified, pass and exit
+if ( $option_help ) {
+   print "-help\n";
+   exit;
+} elsif ( $option_version ) {
+   print "-version\n";
+   exit;
+}
+
 # Create/increment run directory
 my $run_number = 0;
 my @run_directories = <run???>;




More information about the Swift-commit mailing list