Changeset 2504


Ignore:
Timestamp:
01/08/22 09:16:57 (2 years ago)
Author:
nanardon
Message:

add --insert to la-cli/create command

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli.pm

    r2473 r2504  
    290290    open an epty file instead instead attribute list 
    291291 
     292=item --insert 
     293 
     294    open vi in insert mode 
     295 
    292296=item --ro 
    293297 
     
    303307                my ($otype, $objname) = $self->getoption( 
    304308                    { 
    305                         'i'   => \my $interactive, 
    306                         'f=s' => \my $inputfile, 
    307                         'ro'  => \my $with_ro, 
    308                         'e'   => \my $empty_file, 
     309                        'i'      => \my $interactive, 
     310                        'f=s'    => \my $inputfile, 
     311                        'ro'     => \my $with_ro, 
     312                        'e'      => \my $empty_file, 
     313                        'insert' => \my $insert, 
    309314                    }, @_ 
    310315                ); 
     
    378383                                 return; 
    379384                             } 
    380                         } 
     385                        }, 
     386                        insert => $insert, 
    381387                    ); 
    382388                } 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Utils.pm

    r2390 r2504  
    171171 
    172172sub dump_read_temp_file { 
    173     my ($writecb, $readcb) = @_; 
     173    my ($writecb, $readcb, %options) = @_; 
    174174 
    175175    my ($fh, $filename) = tempfile(CLEANUP => 0); 
     
    180180    my @stat = stat($filename); 
    181181    while (1) { 
    182         my $cmd = ($ENV{EDITOR} || 'vi') . " $filename"; 
     182        my $cmd = ($ENV{EDITOR} || 'vi'); 
     183        $cmd .= " -c startinsert " if( $options{insert} ); 
     184        $cmd .= " $filename"; 
    183185        warn "Running $cmd\n"; 
    184186        if (system($cmd) == -1 ) { 
Note: See TracChangeset for help on using the changeset viewer.