diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-09-08 08:01:35 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-09-08 08:01:35 +0000 |
commit | a62613490deacb59d893202c96ea79444c467968 (patch) | |
tree | 02d228958a14195113e1952b4725d54c9bd2b47f | |
parent | cc53d7a77f5e1630fe6c0c3661829f2df3a8da1d (diff) | |
download | drakx-a62613490deacb59d893202c96ea79444c467968.tar drakx-a62613490deacb59d893202c96ea79444c467968.tar.gz drakx-a62613490deacb59d893202c96ea79444c467968.tar.bz2 drakx-a62613490deacb59d893202c96ea79444c467968.tar.xz drakx-a62613490deacb59d893202c96ea79444c467968.zip |
handle options in any order
-rwxr-xr-x | perl-install/standalone/drakupdate_fstab | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/perl-install/standalone/drakupdate_fstab b/perl-install/standalone/drakupdate_fstab index 89689a08b..25fa7ad1c 100755 --- a/perl-install/standalone/drakupdate_fstab +++ b/perl-install/standalone/drakupdate_fstab @@ -31,10 +31,23 @@ $::isStandalone = 1; #- not using standalone.pm which generates too many logs fo log::l("drakupdate_fstab called with @ARGV\n"); -$::testing = $ARGV[0] eq '--test' && shift @ARGV; -$::auto = $ARGV[0] eq '--auto' && shift @ARGV; -my $no_flag = $ARGV[0] eq '--no-flag' && shift @ARGV; -my $debug = $ARGV[0] eq '--debug' && shift @ARGV; +my ($no_flag, $debug, $removed); + +my %args = ( + '--auto' => \$::auto, + '--debug' => \$debug, + '--no-flag' => \$no_flag, + '--test' => \$::testing, + ); + +each_index { + if ($args{$_}) { + ${$args{$_}} = 1; + splice @ARGV, $::i - $removed, 1; + $removed++; + } +} @ARGV; + my ($raw_action, $device_name) = @ARGV; my ($action) = $raw_action =~ /^--(add|del)/; |