Skip to content
Snippets Groups Projects
Commit 02fcd59d authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

added commandline flags, esp. --doit option

parent 83177fc0
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,39 @@ use strict; ...@@ -38,6 +38,39 @@ use strict;
use Data::Dumper; use Data::Dumper;
$Data::Dumper::Indent= 1; $Data::Dumper::Indent= 1;
my $doit= 0;
my $quiet= 0;
my @PARS;
my $arg;
while (defined ($arg= shift (@ARGV)))
{
if ($arg eq '--') { push (@PARS, @ARGV); @ARGV= (); }
elsif ($arg eq '-') { push (@PARS, '-'); }
elsif ($arg =~ /^--(.+)/)
{
my ($opt, $val)= split ('=', $1, 2);
if ($opt eq 'help') { usage(); }
elsif ($opt eq 'doit') { $doit= 1; }
elsif ($opt eq 'quiet') { $quiet= 1; }
else { usage(); }
}
elsif ($arg =~ /^-(.+)/)
{
foreach my $opt (split ('', $1))
{
if ($opt eq 'h') { usage(); exit (0); }
# elsif ($opt eq 'x') { $x_flag= 1; }
elsif ($opt eq 'q') { $quiet= 1; }
else { usage(); }
}
}
else
{
push (@PARS, $arg);
}
}
my %MSIZE= {}; my %MSIZE= {};
my $FC= new FCAT; my $FC= new FCAT;
...@@ -181,10 +214,18 @@ print join (' ', '#', __LINE__, %$fc_m), "\n"; ...@@ -181,10 +214,18 @@ print join (' ', '#', __LINE__, %$fc_m), "\n";
my $p; my $p;
foreach $p (@x_paths) foreach $p (@x_paths)
{
unless ($quiet)
{ {
print "rm '$p'\n"; print "rm '$p'\n";
print "ln '$p1' '$p'\n"; print "ln '$p1' '$p'\n";
} }
if ($doit)
{
system ('rm', $p);
system ('ln', $p1, $p);
}
}
} }
$tsize; $tsize;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment