Changeset 892 for dasscm/trunk/usr/bin


Ignore:
Timestamp:
Jun 26, 2010, 1:19:43 PM (14 years ago)
Author:
joergs
Message:

optimized parameter handling

File:
1 edited

Legend:

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

    r891 r892  
    16591659my $number_arguments = @ARGV;
    16601660
    1661 if ( $number_arguments > 0 ) {
    1662 
    1663     # get subcommand and remove it from @ARGV
     1661# get subcommand and remove it from @ARGV
     1662if( defined( $ARGV[0] ) ) {
    16641663    $command = get_command_uniform_name( $ARGV[0] );
    16651664    shift @ARGV;
    1666 
     1665}
     1666if( not defined($command) ) {
     1667        usage();
     1668        $return_code = $RETURN_NOK;
     1669} else {
    16671670    $DASSCM_LOCAL_REPOSITORY_BASE = $config->{'DASSCM_LOCAL_REPOSITORY_BASE'};
    16681671    $DASSCM_REPOSITORY_NAME       = $config->{'DASSCM_REPOSITORY_NAME'};
     
    17041707    #
    17051708    # action accordinly to command are taken
    1706     # $command is rewritten in standard format,
    1707     # so we can test for it later on more simply
    1708     #
    1709 
    1710     if ( get_command_function($command) ) {
    1711         &{ get_command_function($command) }(@ARGV);
    1712     } else {
    1713         print "unknown command: $command\n\n";
    1714         usage();
    1715         check_env();
    1716         $return_code = $RETURN_NOK;
    1717     }
     1709    #
     1710    &{ get_command_function($command) }(@ARGV);
    17181711}
    17191712
Note: See TracChangeset for help on using the changeset viewer.