summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-10-10 15:30:42 +0000
committerdamien <damien@mandriva.com>2001-10-10 15:30:42 +0000
commit84938e5e491c319c41bd8323a0a529f2d38b559c (patch)
tree55696d8a749c1b1bb050f823a2797b895bbb7daf /perl-install
parent5fb2550227f1ec66440b850e42ac72373990d2b7 (diff)
downloaddrakx-84938e5e491c319c41bd8323a0a529f2d38b559c.tar
drakx-84938e5e491c319c41bd8323a0a529f2d38b559c.tar.gz
drakx-84938e5e491c319c41bd8323a0a529f2d38b559c.tar.bz2
drakx-84938e5e491c319c41bd8323a0a529f2d38b559c.tar.xz
drakx-84938e5e491c319c41bd8323a0a529f2d38b559c.zip
improved options handling
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/drakfont38
1 files changed, 31 insertions, 7 deletions
diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont
index 90b135093..b4bd92074 100755
--- a/perl-install/standalone/drakfont
+++ b/perl-install/standalone/drakfont
@@ -66,13 +66,37 @@ if ("@ARGV" =~ /--help|-h/) {
);
exit(0);
}
-my $xlsfonts = "@ARGV" =~ /--xls_fonts/;
-my $windows = "@ARGV" =~ /--windows_import|-wi/;
-my $strong = "@ARGV" =~ /--strong|-s/;
-my $replace = "@ARGV" =~ /--replace|-r/;
-my ($application) = "@ARGV" =~ /--application (\w+)/;
-my ($install) = "@ARGV" =~ /--install (\w)/;
-my ($uninstall) = "@ARGV" =~ /--uninstall (\w+)/;
+
+my $xlsfonts;
+my $windows;
+my $strong;
+my $replace;
+my $application;
+my $install;
+my $uninstall;
+
+my $mode = -1;
+my @application;
+my @install;
+my @uninstall;
+
+foreach (@ARGV) {
+ /--xls_fonts/ and $xlsfonts = 1, $mode=-1;
+ /--windows_import|-wi/ and $windows = 1, $mode=-1;
+ /--strong|-s/ and $strong = 1, $mode=-1;
+ /--replace|-r/ and $replace = 1, $mode=-1;
+ /--application/ and $mode = 0, next;
+ $mode == 0 and push @application, $_;
+ /--install/ and $mode = 1, next;
+ $mode == 1 and push @install, $_;
+ /--uninstall/ and $mode = 2, next;
+ $mode == 2 and push @uninstall, $_;
+}
+
+print "app : @application\n";
+print "install : @install\n";
+print "uninstall : @uninstall\n";
+print "xx $xlsfonts\n";
my $xfs_conffile = '/etc/X11/fs/config';
my $drakfont_dir = '/home/seb/new_drackfont';