Browse Source

Fix parameter matching

The original regexes would match inside other arguments;

Eg.

    mkexec foo-foo

would match as if -f was presented.
Alois Mahdal 8 years ago
parent
commit
d7af9a2566
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      bin/mkexec

+ 2
- 2
bin/mkexec View File

@@ -22,9 +22,9 @@ my $edit = $DEFAULT_EDIT;
22 22
 my $name; my $type; my $purpose;
23 23
 
24 24
 foreach (@ARGV) {
25
-    if (m/-f|--force/) {
25
+    if (m/\b-f\b|\b--force\b/) {
26 26
         $force++;
27
-    } elsif (m/-e|--edit/) {
27
+    } elsif (m/\b-e\b|\b--edit\b/) {
28 28
         $edit++;
29 29
     } elsif (defined $type) {
30 30
         $purpose = $_;