1. Diab Jerius
  2. Hg::Lib

Commits

Diab Jerius  committed e6f7ce2

add documentation for run method

  • Participants
  • Parent commits 52d8932
  • Branches default

Comments (0)

Files changed (1)

File lib/Hg/Lib/Client.pm

View file
 }
 
 
+=head1 NAME
+
+Hg::Lib::Client
+
+=head1 SYNOPSIS
+
+  $client->run( $cmd, %opts );
+
+
+=head1 DESCRIPTION
+
+B<Hg::Lib::Client> objects are used to send commands to B<mercurial>'s
+command server and retrieve results.  They are created by the
+functions in B<Hg::Lib>; see there for more details on how to do so.
+
+=head1 METHODS
+=head2 Low-level access
+
+=over
+
+=item B<run>
+
+  $client->run( $cmd, %options );
+
+Send a command to the server.  This is a convenience wrapper around
+C<Hg::Lib::Server::Pipe::runcommand>.
+
+=over
+
+=item B<$cmd>
+
+The command to execute, typically built using
+B<Hg::Lib::Utils::prep_cmd>.  It may be a string or an array of
+strings. I<Required>.
+
+=item B<%options>
+
+The following options are available
+
+=over
+
+=item C<prompt>
+
+A reference to a subroutine to be called when the server requires line
+based input.  It will be called as
+
+  $data = $prompt->( $max_bytes, $output );
+
+where C<$max_bytes> is the maximum number of bytes to send and
+C<$output> is the cumulative data sent on the output channel by the
+server for this command.
+
+=item C<input>
+
+A reference to a subroutine to be called when the server requires a
+chunk of input data.  It will be called as
+
+  $data = $input->( $max_bytes );
+
+where C<$max_bytes> is  the maximum number of bytes to
+send.
+
+=item C<eh>
+
+A reference to a subroutine to be called if an error occurs.  It will
+be called as
+
+  $eh->( $ret, $output, $error );
+
+where C<$ret> is the command's return code, and C<$output> and C<$error>
+are any data sent on the output and error channels.
+
+=back
+
+=back
+
+=cut
+
 sub run {
 
     my $self = shift;
     return $output;
 }
 
+
+=back
+
+=cut
+
 1;
 
 __END__
 
+
 =pod
 
-=head1 NAME
-
-Hg::Lib::Client
-
-=head1 VERSION
-
-version 0.01_05
-
-=method
-
-add - add
 
 =head1 AUTHOR