Changeset 38 for LATMOS-Accounts


Ignore:
Timestamp:
04/25/09 02:35:12 (15 years ago)
Author:
nanardon
Message:
  • add doc on la-config
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/bin/la-config

    r35 r38  
    77use Pod::Usage; 
    88 
     9=head1 NAME 
     10 
     11    la-config - Tools to query configuration of LATMOS::Accounts system. 
     12 
     13=head1 SYNOPSIS 
     14 
     15Show configured bases: 
     16 
     17    la-config 
     18 
     19List supported attribute: 
     20 
     21    la-config [option] att 
     22 
     23=cut 
     24 
    925GetOptions( 
    1026    'c|config=s' => \my $config, 
     27    'b|base=s'   => \my $base, 
     28    'help'       => sub { pod2usage(0) }, 
    1129) or pod2usage(); 
     30 
     31=head1 OPTIONS 
     32 
     33=item -c|--config configfile 
     34 
     35Use this configuration file instead default 
     36 
     37=item -b|--base basename 
     38 
     39Perform query on this base 
     40 
     41=cut 
    1242 
    1343my $LA = LATMOS::Accounts->new($config); 
     
    1747    m/^$/ and do { 
    1848        my $default = $LA->default_base_name || ''; 
    19         foreach ($LA->list_bases) { 
     49        foreach ($base ? ($base) : $LA->list_bases) { 
    2050            printf("%s %s (%s)\n", 
    2151                ($_ eq $default ? '*' : ' '), 
     
    2656        last; 
    2757    }; 
     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    }; 
    2866} 
Note: See TracChangeset for help on using the changeset viewer.