-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgg
More file actions
executable file
·40 lines (34 loc) · 694 Bytes
/
Copy pathgg
File metadata and controls
executable file
·40 lines (34 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env perl
use v5.18;
use strict;
use warnings;
my $fuzzp = shift;
my @chars = split "", $fuzzp;
my @re;
push @re, shift @chars;
while (@chars) {
my $c = shift @chars;
push @re, "[^" . $c . "]*", $c;
}
my $re = join "", @re;
while (<>) {
print if /$re/io;
}
__END__
Doing filename "fuzzy" searching from input.
~/src/App-perlbrew
> git ls-files | gg cmd.t
t/command-alias.t
t/command-available.t
t/command-compgen.t
t/command-display-rc.t
t/command-env.t
t/command-exec.t
t/command-help.t
t/command-info.t
t/command-install-cpanm.t
t/command-install-patchperl.t
t/command-lib.t
t/command-list.t
t/failure-command-install-cpanm.t
t/failure-command-install-patchperl.t