Changeset 214 for trunk/dasscm/dasscm


Ignore:
Timestamp:
Jul 3, 2007, 2:10:55 PM (17 years ago)
Author:
joergs
Message:

improvements, bugfixes

Location:
trunk/dasscm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dasscm

    • Property svn:ignore set to
      Changes
      ChangeLog

  • trunk/dasscm/dasscm

    r209 r214  
    88  qw($DASSCM_PROD $DASSCM_REPO $USER $DASSCM_USERNAME $DASSCM_USER $DASSCM_PASSWORD);
    99use Cwd;
    10 use POSIX qw/getpgrp tcgetpgrp/;
    11 use Term::ReadKey;
     10use Getopt::Long;
    1211use File::Basename;
    1312use File::Compare;
     
    1615use File::stat;
    1716use File::Path;
    18 use Getopt::Long;
     17use Term::ReadKey;
    1918
    2019#
     
    3029
    3130my $config_file = "/etc/dasscm.conf";
    32 
    33 # my $config = SmartClient::Config->( $config_file );
    34 my $config = ConfigFile::read_config_file($config_file);
     31my $config      = ConfigFile::read_config_file($config_file);
    3532my $DASSCM_LOCAL_REPOSITORY_BASE;
    3633my $DASSCM_REPOSITORY_NAME;
     
    6966    print "   add <filename>\n";
    7067    print "   commit <filename>\n";
     68    print "   status <filename>\n";
    7169    print "   diff <filename>\n";
    7270    print "   help <subcommand>\n";
     
    7674    print
    7775      "svn checkout --no-auth-cache --username USERNAME https://dass-it.de/svn/dasscm/HOSTNAME\n";
    78     print "environment variables\n", "    DASSCM_REPO\n", "    DASSCM_PROD¸n",
     76    print "environment variables\n", "    DASSCM_REPO\n", "    DASSCM_PROD\n",
    7977      "    DASSCM_USERNAME\n", "    DASSCM_PASSWORD\n", "are evaluated.\n";
    8078    print "\n";
     
    174172    my $basename = basename($filename_prod);
    175173
    176     print "dir: " . $dirname_prod . "\n";
    177     print "fn: " . $basename . "\n";
     174    if ($verbose) {
     175        print "dir: " . $dirname_prod . "\n";
     176        print "fn: " . $basename . "\n";
     177    }
    178178
    179179    my $dirname_repo  = $DASSCM_REPO . "/" . $dirname_prod;
     
    301301    } else {
    302302        print "help for @_: ...\n";
     303        usage();
    303304    }
    304305}
     
    309310    check_env();
    310311
    311     my $output_username = "";
    312     if ($DASSCM_USERNAME) {
    313         $output_username = " ($DASSCM_USERNAME)";
    314     }
    315 
    316     print "Enter DASSCM user name", $output_username, ": ";
    317     my $input_username = <STDIN>;
    318     chomp($input_username);
     312    my $input_username = $1;
     313
     314    if ( not $input_username ) {
     315        my $output_username = "";
     316        if ($DASSCM_USERNAME) {
     317            $output_username = " ($DASSCM_USERNAME)";
     318        }
     319
     320        print "Enter DASSCM user name", $output_username, ": ";
     321        $input_username = <STDIN>;
     322        chomp($input_username);
     323    }
    319324
    320325    # hidden password input
     
    530535
    531536    # get command line options and store them in options hash
    532     my $result = GetOptions( \%options, 'message=s' );
     537    my $result = GetOptions( \%options, 'verbose', 'message=s' );
    533538
    534539    # print options
     
    537542    }
    538543
     544    # set verbose to command line option
     545    $verbose = $options{'verbose'};
     546
     547    #
     548    # action accordinly to command are taken
     549    # $command is rewritten in standard format,
     550    # so we can test for it later on more simply
     551    #
    539552    $_ = $command;
    540553    if (m/help/i) {
     
    547560        init(@ARGV);
    548561    } elsif (m/add/i) {
    549         ## rewrite command
    550562        $command = "add";
    551563        add(@ARGV);
     
    562574        $command = "status";
    563575        status(@ARGV);
    564     } elsif (m/activate/i) {
    565         ## TODO
    566         activate(@ARGV);
     576
     577        #     } elsif (m/activate/i) {
     578        #         ## TODO
     579        #         activate(@ARGV);
    567580    } else {
    568581        usage();
     
    574587    # commitall
    575588    # revert
    576     # status (chkconf)
    577 }
     589}
Note: See TracChangeset for help on using the changeset viewer.