-
Notifications
You must be signed in to change notification settings - Fork 1
/
gd
executable file
·41 lines (31 loc) · 862 Bytes
/
gd
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/perl -w
# Fri 15 Nov 14:00:07 GMT 2019
(my $email='ch%christianjaeger,ch')=~ tr/%,/@./;
use strict; use warnings FATAL => 'uninitialized';
$0=~ /(.*?)([^\/]+)\z/s or die "?";
my ($mydir, $myname)=($1,$2);
sub usage {
print STDERR map{"$myname: $_\n"} @_ if @_;
print "$myname [-i] name-regex
Find directories used by items in the current Git repository.
(Wrapper around gfind, see docs there.)
(Christian Jaeger <$email>)
";
exit (@_ ? 1 : 0);
}
use Getopt::Long;
our $verbose=0;
my $opt_i;
#our $opt_dry;
GetOptions("verbose"=> \$verbose,
"help"=> sub{usage},
"i"=> \$opt_i,
#"dry-run"=> \$opt_dry,
) or exit 1;
usage "expecting 1 non-option argument" unless @ARGV == 1;
my ($regex)= @ARGV;
exec "gfind",
"--path", "^(?!\.METADATA-v2)",
($opt_i ? "-i" : ()),
"--name", $regex,
"--dirs";