Skip to content
Snippets Groups Projects
Commit cb4bec4d authored by Dan Sheppard's avatar Dan Sheppard
Browse files

Add --hideparamlist for use in parallel scripts to hide noise.

parent d89a9899
No related branches found
No related tags found
No related merge requests found
...@@ -127,6 +127,7 @@ sub parse_common_options { ...@@ -127,6 +127,7 @@ sub parse_common_options {
'logappend|log_append', 'logappend|log_append',
'verbose|v', 'verbose|v',
'interactive|i=s', 'interactive|i=s',
'hideparamlist=s',
'dry_run|dry|n', 'dry_run|dry|n',
'help|h|?', 'help|h|?',
); );
...@@ -277,6 +278,7 @@ sub get_common_params { ...@@ -277,6 +278,7 @@ sub get_common_params {
logappend logappend
verbose verbose
interactive interactive
hideparamlist
dry_run dry_run
); );
} }
...@@ -384,6 +386,7 @@ sub confirm_params { ...@@ -384,6 +386,7 @@ sub confirm_params {
my $self = shift; my $self = shift;
# print parameter table # print parameter table
return 1 if($self->param('hideparamlist') and not $self->param('interactive'));
print "Running script with these parameters:\n\n"; print "Running script with these parameters:\n\n";
print $self->list_all_params; print $self->list_all_params;
...@@ -1506,17 +1509,18 @@ sub init_log { ...@@ -1506,17 +1509,18 @@ sub init_log {
my $log = $self->log_filehandle(undef,$date); my $log = $self->log_filehandle(undef,$date);
# print script name, date, user who is running it # print script name, date, user who is running it
my $hostname = `hostname`; unless($self->param('hideparamlist')) {
chomp $hostname; my $hostname = `hostname`;
my $script = "$hostname:$Bin/$Script"; chomp $hostname;
my $user = `whoami`; my $script = "$hostname:$Bin/$Script";
chomp $user; my $user = `whoami`;
$self->log("Script: $script\nDate: ".$self->date_and_time."\nUser: $user\n"); chomp $user;
$self->log("Script: $script\nDate: ".$self->date_and_time."\nUser: $user\n");
# print parameters the script is running with
$self->log("Parameters:\n\n"); # print parameters the script is running with
$self->log($self->list_all_params); $self->log("Parameters:\n\n");
$self->log($self->list_all_params);
}
# remember start time # remember start time
$self->{'_start_time'} = time; $self->{'_start_time'} = time;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment