summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 407049c)
raw | patch | inline | side by side (parent: 407049c)
author | Frank Lichtenheld <frank@lichtenheld.de> | |
Fri, 6 Apr 2007 21:52:41 +0000 (23:52 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 6 Apr 2007 23:46:11 +0000 (16:46 -0700) |
Actually tell the user what he did wrong in case of usage errors
instead of only printing the general usage information.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
instead of only printing the general usage information.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl | patch | blob | history |
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index d3fbcbc15cc2f251fe22c8995f962bc609456d1a..ac74bc51b3197d06f13f588d6916400ac3e6fcf0 100755 (executable)
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M,$opt_A,$opt_S,$opt_L, $opt_a);
my (%conv_author_name, %conv_author_email);
-sub usage() {
+sub usage(;$) {
+ my $msg = shift;
+ print(STDERR "Error: $msg\n") if $msg;
print STDERR <<END;
Usage: ${\basename $0} # fetch/update GIT from CVS
[-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
getopts($opts) or usage();
usage if $opt_h;
-@ARGV <= 1 or usage();
+@ARGV <= 1 or usage("You can't specify more than one CVS module");
if ($opt_d) {
$ENV{"CVSROOT"} = $opt_d;
} elsif ($ENV{"CVSROOT"}) {
$opt_d = $ENV{"CVSROOT"};
} else {
- die "CVSROOT needs to be set";
+ usage("CVSROOT needs to be set");
}
$opt_o ||= "origin";
$opt_s ||= "-";
chomp $cvs_tree;
close $f;
} else {
- usage();
+ usage("CVS module has to be specified");
}
our @mergerx = ();