- Timestamp:
- Jun 26, 2010, 12:57:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dasscm/trunk/usr/bin/dasscm
r890 r891 11 11 use File::Basename; 12 12 use File::Compare; 13 14 # used system("cp -a"), because File::Copy does not keep permissions 15 #use File::Copy; 13 ## used system("cp -a"), because File::Copy does not keep permissions 14 ##use File::Copy; 16 15 use File::Find; 17 16 use File::stat; … … 70 69 # CMD 71 70 # USER 72 # PATH 73 # REPOPATH71 # PATH_PROD 72 # PATH_REPO 74 73 # require: 75 74 # WRITE commands that require write access (and therefore a login) … … 95 94 'ls' => { 96 95 'desc' => [], 97 'params' => [" REPOPATH"],96 'params' => ["PATH_REPO"], 98 97 'function' => \&ls 99 98 }, 100 99 'update' => { 101 100 'desc' => [], 102 'params' => ["PATH "],101 'params' => ["PATH_REPO"], 103 102 'function' => \&update 104 103 }, 105 104 'add' => { 106 105 'desc' => [], 107 'params' => ["PATH "],106 'params' => ["PATH_PROD"], 108 107 'require' => ["WRITE"], 109 108 'function' => \&add … … 111 110 'commit' => { 112 111 'desc' => [], 113 'params' => [" REPOPATH"],112 'params' => ["PATH_REPO"], 114 113 'require' => ["WRITE"], 115 114 'function' => \&commit … … 117 116 'revert' => { 118 117 'desc' => ["revert local changes back to version from repository"], 119 'params' => [" REPOPATH"],118 'params' => ["PATH_REPO"], 120 119 'function' => \&revert 121 120 }, 122 121 'blame' => { 123 'desc' => [], 124 'params' => ["PATH"], 122 'desc' => [], 123 ## TODO: only files from PATH_REPO 124 'params' => ["PATH_REPO"], 125 125 'function' => \&blame 126 126 }, 127 127 'diff' => { 128 128 'desc' => [], 129 'params' => ["PATH "],129 'params' => ["PATH_REPO"], 130 130 'function' => \&diff 131 131 }, 132 132 'status' => { 133 133 'desc' => [], 134 'params' => ["PATH "],134 'params' => ["PATH_REPO"], 135 135 'function' => \&status 136 136 }, … … 969 969 my @files = glob($path); 970 970 971 # if only one result is available972 # and this result is a directory,973 # add another result entry974 # (otherwise complete will stop here and continue with the next parameter)975 971 if ( $#files == 0 ) { 976 my $path = $files[0]; 972 973 # if only one result is available 974 # and this result is a directory, 975 # add another result entry 976 # (directory with and withour trainling /), 977 # otherwise complete will stop here and continue with the next parameter 978 my $path = normalize_path( $files[0] ); 977 979 if ( -d $path ) { 978 push( @files, $path . "/");980 @files = ( substr( $path, 0, -1 ), $path ); 979 981 } 980 982 } else { 983 981 984 # add "/" to all directories 982 @files = map( { -d $_ && $_ ."/" || $_} @files );985 @files = map( { normalize_path($_) } @files ); 983 986 } 984 987 … … 1566 1569 $_ = $i; 1567 1570 if (m/^$input/) { 1568 my $command = get_command_uniform_name($i); 1569 print $command, "\n"; 1571 1572 #my $command = get_command_uniform_name($i); 1573 #print $command, "\n"; 1574 print $i, "\n"; 1570 1575 } 1571 1576 } … … 1576 1581 my @params = get_command_possible_params( $input[0] ); 1577 1582 if ($verbose) { print "params: ", Dumper(@params); } 1578 if ( defined( $params[ $number_arguments - 2 ] ) 1579 && $params[ $number_arguments - 2 ] ) 1583 1584 # arg 1: dasscm 1585 # arg 2: command 1586 # arg 3-x: parameter, therefore parameter_number = $number_arguments - 2 1587 my $parameter_number = $number_arguments - 2; 1588 if ( defined( $params[$parameter_number] ) 1589 && $params[$parameter_number] ) 1580 1590 { 1581 my $param = $params[ $number_arguments - 2 ]; 1582 if ( $param eq "PATH" ) { 1591 my $param = $params[$parameter_number]; 1592 if ($verbose) { print "param used: ", $param, "\n"; } 1593 if ( $param eq "PATH_PROD" ) { 1583 1594 complete_path( $input[ $number_arguments - 1 ] ); 1584 } elsif ( $param eq " REPOPATH" ) {1595 } elsif ( $param eq "PATH_REPO" ) { 1585 1596 complete_repopath( $input[ $number_arguments - 1 ] ); 1586 } else {1587 print "param: $param\n";1588 print Dumper($param);1589 1597 } 1590 1598 }
Note:
See TracChangeset
for help on using the changeset viewer.