From 38784e08dffe5ab8df76f18f9be812f76b1d69cc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 3 Feb 2020 22:53:22 -0700 Subject: 'ask' alias Signed-off-by: Sean Whitton --- lib/Git/Annex/BatchCommand.pm | 8 ++++++++ t/13_batchcommand.t | 2 ++ 2 files changed, 10 insertions(+) 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 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), -- cgit v1.2.3