added option -f
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Sun, 01 Sep 2013 12:13:15 +0200
changeset 4 f5f3abf44414
parent 3 9441d280d863
child 5 7ce40ff50871
added option -f
install
--- a/install	Sun Sep 01 12:10:43 2013 +0200
+++ b/install	Sun Sep 01 12:13:15 2013 +0200
@@ -6,6 +6,12 @@
 use File::Spec::Functions qw(catfile rel2abs abs2rel canonpath);
 use Sys::Hostname;
 use autodie;
+use Getopt::Long;
+
+my $opt_force = 0;
+
+GetOptions('f|force!' => \$opt_force)
+    or die "Usage: $0 [--force]\n";
 
 # list of files/dirs to exclude
 my @exclude = map { qr/$_/ } qw(
@@ -13,6 +19,8 @@
     ^\.hg$
 ), basename $0;
 
+... if $opt_force;
+
 foreach my $this (grep { not $_ ~~ @exclude } glob('.*')) {
 
     my $link = catfile $ENV{HOME}, $this;