summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-03 22:53:22 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-03 22:53:22 -0700
commit38784e08dffe5ab8df76f18f9be812f76b1d69cc (patch)
tree41672b0db23dd23cf7153739a82c89e812021e7b
parentd81f0bf1ee13d0054f15fee94f98bb5b5b494d7a (diff)
downloadp5-Git-Annex-38784e08dffe5ab8df76f18f9be812f76b1d69cc.tar.gz
'ask' alias
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--lib/Git/Annex/BatchCommand.pm8
-rwxr-xr-xt/13_batchcommand.t2
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/Git/Annex/BatchCommand.pm b/lib/Git/Annex/BatchCommand.pm
index 80fdd3c..aacad0e 100644
--- a/lib/Git/Annex/BatchCommand.pm
+++ b/lib/Git/Annex/BatchCommand.pm
@@ -100,6 +100,14 @@ sub say {
return wantarray ? @output : $output[$#output];
}
+=head2 ask($input, ...)
+
+Synonym for C<say> method.
+
+=cut
+
+*Git::Annex::BatchCommand::ask = \&Git::Annex::BatchCommand::say;
+
=head2 restart
Kill and restart the C<--batch> command.
diff --git a/t/13_batchcommand.t b/t/13_batchcommand.t
index 3d72e8f..bb529a4 100755
--- a/t/13_batchcommand.t
+++ b/t/13_batchcommand.t
@@ -53,6 +53,8 @@ with_temp_annexes {
is $response5, "foo/foo2/baz", "it returns a single result into a scalar";
my ($response6) = $batch->say("foo/foo2/baz");
is $response6, "foo/foo2/baz", "it still returns a list in list context";
+ is $batch->ask("foo/foo2/baz"), "foo/foo2/baz",
+ "you can ask as well as say";
undef $batch;
ok !kill(0, $second_pid),