my $delete_good_output = $rsetup->{delete_good_output};
my $FILES_file = $rsetup->{files};
my $PROFILES_file = $rsetup->{profiles};
+my $perltidy = $rsetup->{perltidy};
+
+my $binfile = "perltidy";
+if ($perltidy) {
+ $binfile = "perl $perltidy";
+}
+
+
$FILES_file = "FILES.txt" unless ($FILES_file);
$PROFILES_file = "PROFILES.txt" unless ($PROFILES_file);
print STDERR "\n-----\nRun '$nf.$np' : profile='$profile', ifile='$ifile'\n";
- my $cmd = "perltidy <$ifile >$ofile -pro=$profile";
+ my $cmd = "$binfile <$ifile >$ofile -pro=$profile";
print STDERR "$cmd\n";
system $cmd;
my $efile = "perltidy.ERR";
my $config_file = "config.txt";
my $FILES_file = "FILES.txt";
my $PROFILES_file = "PROFILES.txt";
+my $perltidy = "";
my $rfiles = [];
my $rprofiles = [];
my $chain_mode = $rsetup->{chain_mode};
my $do_syntax_check = $rsetup->{syntax_check};
my $delete_good_output = $rsetup->{delete_good_output};
+ my $perltidy_version = $rsetup->{perltidy};
+ $perltidy_version = "[default]" unless ($perltidy_version);
print <<EOM;
===Main Menu===
R - Read a config file
C - Chain mode : $chain_mode
D - Delete good output? : $delete_good_output
S - Syntax check? : $do_syntax_check
+V - perltidy Version : $perltidy_version
Q - Quit without saving config file
W - Write config, FILES.txt, PROFILES.txt, GO.sh and eXit
EOM
$do_syntax_check = ifyes("Do syntax checking? [Y/N]","N");
$rsetup->{syntax_check} = $do_syntax_check;
}
+ elsif ( $ans eq 'V' ) {
+ my $test =
+ query("Enter the full path to the perltidy binary, or <cr> for default");
+ if ( $test && !-e $test ) {
+ next
+ unless (
+ ifyes("I cannot find that, do you want to use it anyway?") );
+ }
+ $rsetup->{perltidy} = $test;
+ }
elsif ( $ans eq 'Q' ) {
last if ( ifyes("Quit without saving? [Y/N]") );
}
syntax_check => 0,
profiles => $PROFILES_file,
files => $FILES_file,
+ perltidy => $perltidy,
};
return;
}
nohup nice -n19 perltidy_random_run.pl >>nohup.my 2>>nohup.my
EOM
system("chmod +x $runme");
- print STDOUT "now enter ./$runme\n";
+ print STDOUT "Edit $config_file if you want to make any changes\n";
+ print STDOUT "then enter ./$runme\n";
}
sub write_config {