Changeset 38 for LATMOS-Accounts
- Timestamp:
- 04/25/09 02:35:12 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/bin/la-config
r35 r38 7 7 use Pod::Usage; 8 8 9 =head1 NAME 10 11 la-config - Tools to query configuration of LATMOS::Accounts system. 12 13 =head1 SYNOPSIS 14 15 Show configured bases: 16 17 la-config 18 19 List supported attribute: 20 21 la-config [option] att 22 23 =cut 24 9 25 GetOptions( 10 26 'c|config=s' => \my $config, 27 'b|base=s' => \my $base, 28 'help' => sub { pod2usage(0) }, 11 29 ) or pod2usage(); 30 31 =head1 OPTIONS 32 33 =item -c|--config configfile 34 35 Use this configuration file instead default 36 37 =item -b|--base basename 38 39 Perform query on this base 40 41 =cut 12 42 13 43 my $LA = LATMOS::Accounts->new($config); … … 17 47 m/^$/ and do { 18 48 my $default = $LA->default_base_name || ''; 19 foreach ($ LA->list_bases) {49 foreach ($base ? ($base) : $LA->list_bases) { 20 50 printf("%s %s (%s)\n", 21 51 ($_ eq $default ? '*' : ' '), … … 26 56 last; 27 57 }; 58 m/^att(ributes)?$/ and do { 59 my $labase = $base ? $LA->base($base) : $LA->default_base; 60 my $otype = shift(@ARGV) || 'user'; 61 printf "Supported field for object type %s (base %s)\n", 62 $otype, 63 $LA->default_base_name || 'N/A'; 64 print " $_\n" foreach($labase->list_canonicals_fields($otype)); 65 }; 28 66 }
Note: See TracChangeset
for help on using the changeset viewer.