Changeset 849


Ignore:
Timestamp:
03/29/10 19:09:13 (14 years ago)
Author:
nanardon
Message:
  • make unxported mode options more explicit
  • fix POD according behavior
Location:
LATMOS-Accounts
Files:
9 edited

Legend:

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

    r844 r849  
    1010=head1 NAME 
    1111 
    12     la-query - Tools to query base in LATMOS::Accounts system 
     12    la-cli - A powerfull commandline tool to manage LATMOS::Accounts contents 
    1313 
    1414=head1 SYNOPSIS 
    1515 
    16     la-query [options] [obj_id] 
    17  
    18 =item [obj_id] : If present, all set attributes (rw) will be displayed for that obj_id. 
    19         If none is given, all obj_ids will be printed. 
    20  
    21 For the default object_type (user), obj_id = login. 
    22  
    23 Example : la-query lambda 
     16    la-cli [options] 
    2417 
    2518=cut 
    2619 
    2720GetOptions( 
    28     'c|config=s' => \my $config, 
    29     'b|base=s'   => \my $base, 
    30     'noexp'      => \my $noexp, 
    31     'exp'        => \my $exp, 
    32     'help'       => sub { pod2usage(0) }, 
     21    'c|config=s'        => \my $config, 
     22    'b|base=s'          => \my $base, 
     23    'no-unexp|wo-unexp' => \my $nounexp, 
     24    'with-unexp'        => \my $unexp, 
     25    'help'              => sub { pod2usage(0) }, 
    3326) or pod2usage(); 
    3427 
     
    4538Query this specific base instead of the default one. 
    4639 
    47 =item --noexp 
     40=item --unexp 
    4841 
    4942Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
    5043 
    51 =item --exp 
     44=item --no-unexp 
    5245 
    5346Take into account only propagated objects (attribute 'exported'=1) (default) 
     
    6154$labase && $labase->load or die "Cannot load base"; 
    6255 
    63 $labase->wexported($noexp ? 0 : 1); 
     56$labase->unexported($nounexp ? 0 : 1); 
    6457 
    6558my $globalenv = LATMOS::Accounts::Cli::globalenv($labase); 
  • LATMOS-Accounts/bin/la-group

    r669 r849  
    2020 
    2121GetOptions( 
    22     'c|config=s' => \my $config, 
    23     'b|base=s'   => \my $base, 
    24     's'          => \my $set, 
    25     'r'          => \my $remove, 
    26     'noexp'      => \my $noexp, 
    27     'exp'        => \my $exp, 
    28     'help'       => sub { pod2usage(0) }, 
     22    'c|config=s'        => \my $config, 
     23    'b|base=s'          => \my $base, 
     24    's'                 => \my $set, 
     25    'r'                 => \my $remove, 
     26    'no-unexp|wo-unexp' => \my $nounexp, 
     27    'with-unexp'        => \my $unexp, 
     28    'help'              => sub { pod2usage(0) }, 
    2929) or pod2usage(); 
    3030 
     
    4949Query this specific base instead of the default one. 
    5050 
    51 =item --noexp 
     51=item --with-unexp 
    5252 
    53 Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
     53Take into account all objects (even non propagated ones, with attribute 
     54'exported'=0) (default) 
    5455 
    55 =item --exp 
     56=item --wo-unexp 
    5657 
    57 Take into account only propagated objects (attribute 'exported'=1) (default) 
     58Take into account only propagated objects (attribute 'exported'=1) 
    5859 
    5960=item -r 
     
    7576$labase && $labase->load or die "Cannot load base"; 
    7677 
    77 $labase->wexported($noexp ? 0 : 1); 
     78$labase->unexported($nounexp ? 0 : 1); 
    7879 
    7980$labase->is_supported_object($otype) or die "$otype object unsupported\n"; 
  • LATMOS-Accounts/bin/la-guser

    r669 r849  
    2020 
    2121GetOptions( 
    22     'c|config=s' => \my $config, 
    23     'b|base=s'   => \my $base, 
    24     's'          => \my $set, 
    25     'r'          => \my $remove, 
    26     'noexp'      => \my $noexp, 
    27     'exp'        => \my $exp, 
    28     'help'       => sub { pod2usage(0) }, 
     22    'c|config=s'        => \my $config, 
     23    'b|base=s'          => \my $base, 
     24    's'                 => \my $set, 
     25    'r'                 => \my $remove, 
     26    'no-unexp|wo-unexp' => \my $nounexp, 
     27    'with-exp'          => \my $unexp, 
     28    'help'              => sub { pod2usage(0) }, 
    2929) or pod2usage(); 
    3030 
     
    4949Query this specific base instead of the default one. 
    5050 
    51 =item --noexp 
     51=item --with-unexp 
    5252 
    53 Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
     53Take into account all objects (even non propagated ones, with attribute 
     54'exported'=0) (default) 
    5455 
    55 =item --exp 
     56=item --wo-unexp 
    5657 
    57 Take into account only propagated objects (attribute 'exported'=1) (default) 
     58Take into account only propagated objects (attribute 'exported'=1) 
    5859 
    5960=item -r 
     
    7576$labase && $labase->load or die "Cannot load base"; 
    7677 
    77 $labase->wexported($noexp ? 0 : 1); 
     78$labase->unexported($nounexp ? 0 : 1); 
    7879 
    7980$labase->is_supported_object($otype) or die "$otype object unsupported\n"; 
  • LATMOS-Accounts/bin/la-qacls

    r669 r849  
    2323 
    2424GetOptions( 
    25     'c|config=s' => \my $config, 
    26     'b|base=s'     => \my $base, 
    27     'o|object=s' => \my $otype, 
    28     'u|user=s'   => \my $user, 
    29     'noexp'      => \my $noexp, 
    30     'exp'        => \my $exp, 
    31     'help'       => sub { pod2usage(0) }, 
     25    'c|config=s'        => \my $config, 
     26    'b|base=s'          => \my $base, 
     27    'o|object=s'        => \my $otype, 
     28    'u|user=s'          => \my $user, 
     29    'no-unexp|wo-unexp' => \my $nounexp, 
     30    'exp'               => \my $unexp, 
     31    'help'              => sub { pod2usage(0) }, 
    3232) or pod2usage(); 
    3333 
     
    4444Query this specific base instead of the default one. 
    4545 
    46 =item --noexp 
     46=item --with-unexp 
    4747 
    4848Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
    4949 
    50 =item --exp 
     50=item --wo-unexp 
    5151 
    5252Take into account only propagated objects (attribute 'exported'=1) (default) 
     
    6666my $labase = $base ? $LA->base($base) : $LA->default_base; 
    6767 
    68 $labase->wexported($noexp ? 0 : 1); 
     68$labase->unexported($unexp ? 1 : 0); 
    6969 
    7070if ($user) { 
  • LATMOS-Accounts/bin/la-query

    r827 r849  
    2525 
    2626GetOptions( 
    27     'c|config=s' => \my $config, 
    28     'b|base=s'   => \my $base, 
    29     'o|object=s' => \my $otype, 
    30     'e|empty'    => \my $empty_attr, 
    31     'fmt=s'      => \my $fmt, 
    32     'filefmt=s'  => \my $filefmt, 
    33     'ro'         => \my $with_ro, 
    34     'noexp'      => \my $noexp, 
    35     'exp'        => \my $exp, 
    36     'help'       => sub { pod2usage(0) }, 
     27    'c|config=s'        => \my $config, 
     28    'b|base=s'          => \my $base, 
     29    'o|object=s'        => \my $otype, 
     30    'e|empty'           => \my $empty_attr, 
     31    'fmt=s'             => \my $fmt, 
     32    'filefmt=s'         => \my $filefmt, 
     33    'ro'                => \my $with_ro, 
     34    'no-unexp|wo-unexp' => \my $nounexp, 
     35    'with-unexp'        => \my $unexp, 
     36    'help'              => sub { pod2usage(0) }, 
    3737) or pod2usage(); 
    3838 
     
    5555Query will be performed on this object. Default is the 'User' object. 
    5656 
    57 =item --noexp 
     57=item --with-unexp 
    5858 
    59 Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
     59Take into account all objects (even non propagated ones, with attribute 
     60'exported'=0) (default) 
    6061 
    61 =item --exp 
     62=item --wo-unexp 
    6263 
    63 Take into account only propagated objects (attribute 'exported'=1) (default) 
     64Take into account only propagated objects (attribute 'exported'=1) 
    6465 
    6566=item -e|--empty 
     
    114115$labase && $labase->load or die "Cannot load base"; 
    115116 
    116 $labase->wexported($noexp ? 0 : 1); 
     117$labase->unexported($nounexp ? 0 : 1); 
    117118 
    118119if ($filefmt){ 
  • LATMOS-Accounts/bin/la-search

    r729 r849  
    2727Perform search in this specific base instead default 
    2828 
    29 =item --noexp 
     29=item --with-unexp 
    3030 
    31 Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
     31Take into account all objects (even non propagated ones, with attribute 
     32'exported'=0) (default) 
    3233 
    33 =item --exp 
     34=item --wo-unexp 
    3435 
    35 Take into account only propagated objects (attribute 'exported'=1) (default) 
     36Take into account only propagated objects (attribute 'exported'=1) 
    3637 
    3738=item --fmt format 
     
    7778 
    7879GetOptions( 
    79     'c|config=s' => \my $config, 
    80     'b|base=s'   => \my $base, 
    81     'o|object=s' => \my $otype, 
    82     'fmt=s'      => \my $fmt, 
    83     'noexp'      => \my $noexp, 
    84     'exp'        => \my $exp, 
    85     'help'       => sub { pod2usage(0) }, 
     80    'c|config=s'        => \my $config, 
     81    'b|base=s'          => \my $base, 
     82    'o|object=s'        => \my $otype, 
     83    'fmt=s'             => \my $fmt, 
     84    'no-unexp|wo-unexp' => \my $nounexp, 
     85    'with-unexp'        => \my $unexp, 
     86    'help'              => sub { pod2usage(0) }, 
    8687) or pod2usage(); 
    8788 
     
    9495$labase && $labase->load or die "Cannot load base"; 
    9596 
    96 $labase->wexported($noexp ? 0 : 1); 
     97$labase->unexported($nounexp ? 0 : 1); 
    9798 
    9899my @result = $labase->search_objects($otype, @ARGV); 
  • LATMOS-Accounts/bin/la-web-directory

    r833 r849  
    2626 
    2727GetOptions( 
    28     'c|config=s' => \my $config, 
    29     'b|base=s'   => \my $base, 
    30     'noexp'      => \my $noexp, 
    31     'exp'        => \my $exp, 
    32     'noexpire'   => \my $noexpire, 
    33     'filter=s'   => \my @filters, 
    34     'help'       => sub { pod2usage(0) }, 
     28    'c|config=s'        => \my $config, 
     29    'b|base=s'          => \my $base, 
     30    'wo-unexp|no-unexp' => \my $nounexp, 
     31    'with-unexp'        => \my $unexp, 
     32    'noexpire'          => \my $noexpire, 
     33    'filter=s'          => \my @filters, 
     34    'help'              => sub { pod2usage(0) }, 
    3535) or pod2usage(); 
    3636 
     
    4747Query this specific base instead of the default one. 
    4848 
    49 =item --noexp 
     49=item --with-unexp 
    5050 
    5151Take into account all objects (even non propagated ones, with attribute 'exported'=0) 
    52 (default) 
    5352 
    54 =item --exp 
     53=item --wo-unexp 
    5554 
    56 Take into account only propagated objects (attribute 'exported'=1) 
     55Take into account only propagated objects (attribute 'exported'=1) (default) 
    5756 
    5857=item --noexpire 
     
    6766$labase && $labase->load or die "Cannot load base"; 
    6867 
    69 $labase->wexported($exp ? 1 : 0); 
     68$labase->unexported($unexp ? 1 : 0); 
    7069my %users; 
    7170my $now = strftime('%Y/%m/%d', gmtime); 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm

    r783 r849  
    5353} 
    5454 
    55 sub wexported { 
     55sub wexported { unexported(@_) } 
     56 
     57sub unexported { 
    5658    my ($self, $wexported) = @_; 
    5759    my $old = $self->{wexported}; 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Cli.pm

    r848 r849  
    1717    my $env = LATMOS::Accounts::Cli->new({ prompt => sub { $_[0]->base->label . " cli > " }, }, 
    1818        $labase); 
     19    $env->add_func('unexported', { 
     20        help => 'unexported yes|no|show - switch or show base mode regarding' . 
     21            ' unexported objects', 
     22        completion => sub { 
     23            if (!$_[2]) { 
     24                return qw(yes no show); 
     25            } 
     26        }, 
     27        code => sub { 
     28            my ($env, $arg) = @_; 
     29            if ($arg eq 'yes') { 
     30                $env->base->unexported(1); 
     31                print $OUT "Unexported are now show"; 
     32            } elsif ($arg eq 'no') { 
     33                $env->base->unexported(0); 
     34                print $OUT "Unexported are no longer show"; 
     35            } elsif ($arg eq 'show') { 
     36                print $OUT "Unexported objects " . $env->base->unexported ? 
     37                "enable" : "disable"; 
     38            } else { 
     39                print $OUT "wrong argument"; 
     40            } 
     41        }, 
     42    }); 
    1943    $env->add_func('ls', { 
    2044            help => 'ls object_type - list object of type object_type',  
Note: See TracChangeset for help on using the changeset viewer.