Changeset 849 for LATMOS-Accounts/lib


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/lib/LATMOS/Accounts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.