Skip to content

Commit

Permalink
update grepfile
Browse files Browse the repository at this point in the history
  • Loading branch information
orangeSi committed Aug 27, 2020
1 parent 7691d6e commit 36c3b91
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
Binary file modified grepfile
Binary file not shown.
17 changes: 14 additions & 3 deletions grepfile.cr
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GrepFile < Admiral::Command
#app = __FILE__.gsub(/\.cr$/, "")
#puts `#{app} --help`
#exit 1
puts "Contact: [email protected] or go to https://github.com/orangeSi/grepfile/issues"
puts "Contact: https://github.com/orangeSi/grepfile/issues"
GrepFile.run "--help"
end

Expand Down Expand Up @@ -93,13 +93,24 @@ class GrepFile < Admiral::Command
end
end

else
else # flags.invert_match >=1
if flags.exact_match >=1
if !query_ids.has_key?(id)
puts "#{line}"
end
else
raise "error: --invert_match #{flags.invert_match} not support --exact_match=#{flags.exact_match}"
#raise "error: --invert_match #{flags.invert_match} not support --exact_match=#{flags.exact_match}"
matched_flag = 0
query_ids.each_key do |k|
if id=~ /#{k}/
matched_flag = 1
break
end
end
if matched_flag == 0
puts "#{line}"
end

end
end
end
Expand Down
28 changes: 28 additions & 0 deletions grepfile.wrap.x86-64
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

#/bin/sh
source /home/sikaiwei/crystal/env.sh
base=`dirname $(readlink -f $0)`
bin_name=grepfile
binary=/home/sikaiwei/crystal/grepfile

if [ ! -f "$binary" ]
then

if [ ! -f "$base/$bin_name" ];
then
echo "error, $binary or $base/$bin_name both not exists"
exit
else
binary=$base/$bin_name
fi
fi


if [ "$1" == "" ];
then
$binary --help
exit
fi
time $binary $@ &&
echo done

0 comments on commit 36c3b91

Please sign in to comment.