浏览代码

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 年前
父节点
当前提交
d7af9a2566
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      bin/mkexec

+ 2
- 2
bin/mkexec 查看文件

@@ -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 = $_;