Changeset 888 for dasscm/trunk


Ignore:
Timestamp:
Jun 26, 2010, 12:16:44 AM (14 years ago)
Author:
joergs
Message:

cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dasscm/trunk/usr/bin/dasscm

    r887 r888  
    955955}
    956956
     957
     958#
     959# use globbing to get lsit of files
     960# that matches the given prefix
     961# used for bash completion
     962#
     963sub get_complete_path_globbing( $ )
     964{
     965    my $path = shift;
     966
     967    # add globbing
     968    $path .= "*";
     969
     970    # get files
     971    my @files = glob( $path );
     972
     973    # if only one result is available
     974    # and this result is a directory,
     975    # add another result entry
     976    # (otherwise complete will stop here and continue with the next parameter)
     977    if( $#files == 0 ) {
     978        my $path = $files[0];
     979        if( -d $path ) {
     980            push( @files, $path . "/" );
     981        }
     982    }
     983
     984    return @files;
     985}
     986
     987
    957988#####################################################################
    958989#
     
    15601591
    15611592
    1562 
    15631593sub complete_path(@)
    15641594{
     
    15741604    ) = get_filenames( $_[0] );
    15751605
    1576     my $path = $filename_prod . "*";
    1577 
    1578     my @files = glob( $path );
    1579 
    1580     # if only one result is available
    1581     # and this result is a directory,
    1582     # add another result entry
    1583     # (otherwise complete will stop here and continue with the next parameter)
    1584     if( $#files == 0 ) {
    1585         my $path = $files[0];
    1586         if( -d $path ) {
    1587             push( @files, $path . "/" );
    1588         }
    1589     }
     1606    my @files = get_complete_path_globbing( $filename_prod );
    15901607
    15911608    if (@files) {
     
    16101627    ) = get_filenames( $_[0] );
    16111628
    1612     my $path = $filename_repo . "*";
    1613 
    1614     my @files = glob( $path );
    1615 
    1616     # if only one result is available
    1617     # and this result is a directory,
    1618     # add another result entry
    1619     # (otherwise complete will stop here and continue with the next parameter)
    1620     if( $#files == 0 ) {
    1621         my $path = $files[0];
    1622         if( -d $path ) {
    1623             push( @files, $path . "/" );
    1624         }
    1625     }
     1629    my @files = get_complete_path_globbing( $filename_repo );
    16261630   
    16271631    if (@files) {
Note: See TracChangeset for help on using the changeset viewer.