2012-03-16 04:55:39 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use lib $ENV{GL_BINDIR};
|
|
|
|
use Gitolite::Rc;
|
|
|
|
use Gitolite::Common;
|
|
|
|
|
|
|
|
=for usage
|
|
|
|
Usage: gitolite help
|
|
|
|
|
|
|
|
Prints a list of custom commands available at this gitolite installation.
|
|
|
|
=cut
|
|
|
|
|
2012-03-19 17:04:07 +01:00
|
|
|
usage() if @ARGV;
|
|
|
|
|
2012-03-16 04:55:39 +01:00
|
|
|
my $user = $ENV{GL_USER} || '';
|
2012-03-17 03:10:17 +01:00
|
|
|
print "hello" . ( $user ? " $user" : "" ) . ", this is gitolite3 " . version() . " on git " . substr( `git --version`, 12 ) . "\n";
|
2012-03-16 04:55:39 +01:00
|
|
|
|
|
|
|
_chdir("$ENV{GL_BINDIR}/commands");
|
|
|
|
|
2012-03-17 03:10:17 +01:00
|
|
|
print "list of " . ( $user ? "remote" : "gitolite" ) . " commands available:\n\n";
|
2012-03-16 04:55:39 +01:00
|
|
|
|
|
|
|
for my $c (`find . -type f|sort`) {
|
|
|
|
chomp($c);
|
|
|
|
$c =~ s(^./)();
|
|
|
|
next unless -x $c;
|
|
|
|
|
|
|
|
# if it's from a remote client, show only what he is allowed
|
|
|
|
next if $user and not $rc{COMMANDS}{$c};
|
|
|
|
|
|
|
|
print "\t$c\n";
|
|
|
|
}
|
|
|
|
print "\n";
|
|
|
|
|
|
|
|
exit 0;
|