usage() needed some minor fixes...
This commit is contained in:
parent
32494cfa0c
commit
3f7edfea67
|
@ -84,15 +84,11 @@ sub _die {
|
|||
|
||||
sub usage {
|
||||
_warn(shift) if @_;
|
||||
my ( $script, $function ) = ( caller(1) )[ 1, 3 ];
|
||||
if ( not $script ) {
|
||||
$script = (caller)[1];
|
||||
$function = 'usage';
|
||||
}
|
||||
dbg( "u s a g e", $script, $function );
|
||||
my $script = (caller)[1];
|
||||
my $function = ( ( ( caller(1) )[3] ) || ( ( caller(0) )[3] ) );
|
||||
$function =~ s/.*:://;
|
||||
my $code = slurp($script);
|
||||
$code =~ /^=for $function(.*?)^=cut/sm;
|
||||
$code =~ /^=for $function\b(.*?)^=cut/sm;
|
||||
say2( $1 ? $1 : "...no usage message in $script" );
|
||||
exit 1;
|
||||
}
|
||||
|
|
|
@ -24,15 +24,6 @@ Notes:
|
|||
The 'any' ref is special -- it ignores deny rules (see docs for what this
|
||||
means and exceptions).
|
||||
|
||||
Advanced use (examples only):
|
||||
|
||||
gitolite list-phy-repos | gitolite access % gitweb R | grep -v DENIED | cut -f1 > ~/projects.list
|
||||
# now people can stop thinking gitolite has anything to do with gitweb!
|
||||
|
||||
gitolite list-phy-repos | grep foo |
|
||||
perl -lne 'print "$_ gitweb\n$_ daemon"' |
|
||||
gitolite access % % R | grep -v DENIED | cut -f1 > insecure.repos
|
||||
|
||||
For each case where access is not denied, one line is printed like this:
|
||||
|
||||
reponame<tab>username<tab>access rights
|
||||
|
@ -40,6 +31,8 @@ For each case where access is not denied, one line is printed like this:
|
|||
This is orders of magnitude faster than running the command multiple times;
|
||||
you'll notice if you have more than a hundred or so repos.
|
||||
|
||||
Advanced uses: see src/commands/post-compile/update-git-daemon-access-list for
|
||||
a good example.
|
||||
=cut
|
||||
|
||||
# TODO: deal with "C", call it ^C
|
||||
|
|
|
@ -12,6 +12,8 @@ Usage: gitolite help
|
|||
Prints a list of custom commands available at this gitolite installation.
|
||||
=cut
|
||||
|
||||
usage() if @ARGV;
|
||||
|
||||
my $user = $ENV{GL_USER} || '';
|
||||
print "hello" . ( $user ? " $user" : "" ) . ", this is gitolite3 " . version() . " on git " . substr( `git --version`, 12 ) . "\n";
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ GetOptions(
|
|||
'h' => \$help,
|
||||
) or usage();
|
||||
|
||||
usage() if @ARGV > 1;
|
||||
usage() if @ARGV > 1 or $help;
|
||||
$patt = shift || '.';
|
||||
|
||||
my $user = $ENV{GL_USER} or _die "GL_USER not set";
|
||||
|
|
Loading…
Reference in a new issue