From 1d413ef77cc040451b89a6a624d945cd2708386f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 7 Jul 2009 00:05:23 -0500 Subject: reformat a bunch of comments --- lib/IO/Pty/Easy.pm | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm index 6564eca..f1f0c62 100644 --- a/lib/IO/Pty/Easy.pm +++ b/lib/IO/Pty/Easy.pm @@ -31,9 +31,12 @@ IO::Pty::Easy - Easy interface to IO::Pty =head1 DESCRIPTION -C provides an interface to L which hides most of the ugly details of handling ptys, wrapping them instead in simple spawn/read/write commands. +C provides an interface to L which hides most of the +ugly details of handling ptys, wrapping them instead in simple spawn/read/write +commands. -C uses L internally, so it inherits all of the portability restrictions from that module. +C uses L internally, so it inherits all of the +portability restrictions from that module. =cut @@ -43,21 +46,25 @@ C uses L internally, so it inherits all of the portabili =head2 new() -The C constructor initializes the pty and returns a new C object. The constructor recognizes these parameters: +The C constructor initializes the pty and returns a new C +object. The constructor recognizes these parameters: =over 4 =item handle_pty_size -A boolean option which determines whether or not changes in the size of the user's terminal should be propageted to the pty object. Defaults to true. +A boolean option which determines whether or not changes in the size of the +user's terminal should be propageted to the pty object. Defaults to true. =item def_max_read_chars -The maximum number of characters returned by a C call. This can be overridden in the C argument list. Defaults to 8192. +The maximum number of characters returned by a C call. This can be +overridden in the C argument list. Defaults to 8192. =item raw -A boolean option which determines whether or not to call L after C. Defaults to true. +A boolean option which determines whether or not to call L +after C. Defaults to true. =back @@ -178,9 +185,16 @@ sub spawn { Read data from the process running on the pty. -C takes two optional arguments: the first is the number of seconds (possibly fractional) to block for data (defaults to blocking forever, 0 means completely non-blocking), and the second is the maximum number of bytes to read (defaults to the value of C, usually 8192). The requirement for a maximum returned string length is a limitation imposed by the use of C, which we use internally. +C takes two optional arguments: the first is the number of seconds +(possibly fractional) to block for data (defaults to blocking forever, 0 means +completely non-blocking), and the second is the maximum number of bytes to read +(defaults to the value of C, usually 8192). The requirement +for a maximum returned string length is a limitation imposed by the use of +C, which we use internally. -Returns C on timeout, the empty string on EOF, or a string of at least one character on success (this is consistent with C and L). +Returns C on timeout, the empty string on EOF, or a string of at least +one character on success (this is consistent with C and +L). =cut @@ -209,9 +223,13 @@ sub read { Writes a string to the pty. -The first argument is the string to write, which is followed by one optional argument, the number of seconds (possibly fractional) to block for, taking the same values as C. +The first argument is the string to write, which is followed by one optional +argument, the number of seconds (possibly fractional) to block for, taking the +same values as C. -Returns undef on timeout, 0 on failure to write, or the number of bytes actually written on success (this may be less than the number of bytes requested; this should be checked for). +Returns undef on timeout, 0 on failure to write, or the number of bytes +actually written on success (this may be less than the number of bytes +requested; this should be checked for). =cut @@ -264,9 +282,13 @@ sub is_active { =head2 kill() -Sends a signal to the process currently running on the pty (if any). Optionally blocks until the process dies. +Sends a signal to the process currently running on the pty (if any). Optionally +blocks until the process dies. -C takes two optional arguments. The first is the signal to send, in any format that the perl C command recognizes (defaulting to "TERM"). The second is a boolean argument, where false means to block until the process dies, and true means to just send the signal and return. +C takes two optional arguments. The first is the signal to send, in any +format that the perl C command recognizes (defaulting to "TERM"). The +second is a boolean argument, where false means to block until the process +dies, and true means to just send the signal and return. Returns 1 if a process was actually signaled, and 0 otherwise. @@ -285,7 +307,8 @@ sub kill { =head2 close() -Kills any subprocesses and closes the pty. No other operations are valid after this call. +Kills any subprocesses and closes the pty. No other operations are valid after +this call. =cut -- cgit v1.2.3-54-g00ecf