'gitolite list-groups' added
This commit is contained in:
parent
b0ceac2594
commit
1be66dc10e
|
@ -6,6 +6,8 @@ package Gitolite::Conf::Load;
|
|||
@EXPORT = qw(
|
||||
load
|
||||
access
|
||||
|
||||
list_groups
|
||||
);
|
||||
|
||||
use Exporter 'import';
|
||||
|
@ -169,5 +171,22 @@ sub data_version_mismatch {
|
|||
return $data_version ne $current_data_version;
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# api functions
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# list all groups
|
||||
sub list_groups {
|
||||
die "\nUsage: gitolite list-groups\n\n(no options, no flags)\n\n" if @ARGV;
|
||||
|
||||
load_common();
|
||||
|
||||
my @g = ();
|
||||
while (my ($k, $v) = each ( %groups )) {
|
||||
push @g, @{ $v };
|
||||
}
|
||||
return (sort_u(\@g));
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
6
gitolite
6
gitolite
|
@ -11,6 +11,7 @@ The following subcommands are available; they should all respond to '-h':
|
|||
setup 1st run: initial setup; all runs: hook fixups
|
||||
compile compile gitolite.conf
|
||||
query-rc get values of rc variables
|
||||
list-groups list all group names in conf
|
||||
=cut
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
@ -50,5 +51,10 @@ sub args {
|
|||
require Gitolite::Commands::QueryRc;
|
||||
Gitolite::Commands::QueryRc->import;
|
||||
query_rc();
|
||||
} elsif ( $command eq 'list-groups' ) {
|
||||
shift @ARGV;
|
||||
require Gitolite::Conf::Load;
|
||||
Gitolite::Conf::Load->import;
|
||||
print "$_\n" for ( @{ list_groups() } );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue