aboutsummaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorRyan Anderson <ryan@michonline.com>2006-02-05 20:13:52 -0500
committerJunio C Hamano <junkio@cox.net>2006-02-05 18:23:53 -0800
commit2718435b7b746c3c249525b02fbcbad68f5a45f3 (patch)
tree68a19468d086a2ed712bc53f1aafc99732a91e3c /git-send-email.perl
parentdf9892ffce46d1f1bd6fe64aa445be2ffe7346cf (diff)
downloadgit-2718435b7b746c3c249525b02fbcbad68f5a45f3.tar.gz
git-2718435b7b746c3c249525b02fbcbad68f5a45f3.tar.xz
git-send-email: Fully implement --quiet and document it.
Also reorganizes the man page to list options alphabetically. Signed-off-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl19
1 files changed, 13 insertions, 6 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 2977b9ade..3f1b3ca78 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -186,7 +186,9 @@ for my $f (@ARGV) {
}
if (@files) {
- print $_,"\n" for @files;
+ unless ($quiet) {
+ print $_,"\n" for (@files);
+ }
} else {
print <<EOT;
git-send-email [options] <file | directory> [... file | directory ]
@@ -213,6 +215,10 @@ Options:
--smtp-server If set, specifies the outgoing SMTP server to use.
Defaults to localhost.
+ --quiet Make git-send-email less verbose. One line per email should be
+ all that is output.
+
+
Error: Please specify a file or a directory on the command line.
EOT
exit(1);
@@ -268,7 +274,9 @@ sub send_message
sendmail(%mail) or die $Mail::Sendmail::error;
- unless ($quiet) {
+ if ($quiet) {
+ printf "Sent %s\n", $subject;
+ } else {
print "OK. Log says:\n", $Mail::Sendmail::log;
print "\n\n"
}
@@ -280,7 +288,6 @@ make_message_id();
$subject = $initial_subject;
foreach my $t (@files) {
- my $F = $t;
open(F,"<",$t) or die "can't open file $t";
@cc = ();
@@ -298,7 +305,7 @@ foreach my $t (@files) {
} elsif (/^(Cc|From):\s+(.*)$/) {
printf("(mbox) Adding cc: %s from line '%s'\n",
- $2, $_);
+ $2, $_) unless $quiet;
push @cc, $2;
}
@@ -310,7 +317,7 @@ foreach my $t (@files) {
# So let's support that, too.
if (@cc == 0) {
printf("(non-mbox) Adding cc: %s from line '%s'\n",
- $_, $_);
+ $_, $_) unless $quiet;
push @cc, $_;
@@ -330,7 +337,7 @@ foreach my $t (@files) {
chomp $c;
push @cc, $c;
printf("(sob) Adding cc: %s from line '%s'\n",
- $c, $_);
+ $c, $_) unless $quiet;
}
}
}