diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-03 22:52:53 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-03 22:52:53 -0700 |
commit | d81f0bf1ee13d0054f15fee94f98bb5b5b494d7a (patch) | |
tree | b89fbbfb1f5fe3050a2ced718b16ddf5e3947391 /lib | |
parent | d191a33ce44be3c4e8242fd0b3abed365a9abf20 (diff) | |
download | p5-Git-Annex-d81f0bf1ee13d0054f15fee94f98bb5b5b494d7a.tar.gz |
change what Git::Annex:BatchCommand::say does in scalar context
I believe this is more useful.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Git/Annex/BatchCommand.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Git/Annex/BatchCommand.pm b/lib/Git/Annex/BatchCommand.pm index e9e9379..80fdd3c 100644 --- a/lib/Git/Annex/BatchCommand.pm +++ b/lib/Git/Annex/BatchCommand.pm @@ -82,9 +82,9 @@ sub new { Say a line or lines of input to the batch command's standard input. Trailing line breaks in C<$input> are optional. -In list context, returns a list of chomped git-annex's responses to -the items of input, chomped. In scalar context, returns the number of -trueish responses. +In list context, returns a list of git-annex's responses to the items +of input, chomped. In scalar context, returns the last of git-annex's +responses, chomped. =cut @@ -97,7 +97,7 @@ sub say { chomp(my $out = readline $self->{_out}); push @output, $out; } - return wantarray ? @output : scalar @output; + return wantarray ? @output : $output[$#output]; } =head2 restart |