The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Zoidberg::Fish::History - History plugin for the Zoidberg shell

SYNOPSIS

This module is a Zoidberg plugin, see Zoidberg::Fish for details.

DESCRIPTION

This module provides a history log for the zoidberg shell.

FIXME OUT OF DATE DOC !

EXPORT

None by default.

DATA

The history records used by this module are of the format: [ $command_string, \@arguments, \%properties ].

The command string simply simply be the command as entered on the prompt.

The array arguments are environment vars suppleid by the buffer -- the history just stores them but does not use them in any way.

The properties hash contains meta data used by both history and other plugins. It is possible to add any property to a history record, see METHODS for the api, default implemented are: "time" => touch time, "redun" => number of times the same command was entered, and "exec" => if true the command really was executed. This last property is set by Zoidberg::Buffer.

METHODS

add($string, @args)

Stores both string and array arguments in history

get($action, $int)

Returns history record. $action can be 'current', 'prev' or 'next'

example: get_hist('prev', 10) returns record from 10 entries back

returned records are of the format ( $string, \@args, \%props)

list()

lists all strings in history as array ref -- does not output args nor props

del($offset, $length)

like a splice on the history, without arguments deletes last entry

set_prop($prop_name, $value, $index)

Sets property $prop_name to value $value for the history record with the index $index. If index is omitted sets property for last entry.

get_prop($prop_name, $index)

Returns the value of property $prop_name for the record with index $index. If index is omitted sets property for last entry.

search()

TODO - search on string or property

show()

TODO - should print hist nicely formatted

AUTHOR

Jaap Karssenberg || Pardus [Larus] <pardus@cpan.org>

R.L. Zwart, <rlzwart@cpan.org>

Copyright (c) 2002 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Zoidberg, Zoidberg::Fish, Zoidberg::Buffer, http://zoidberg.sourceforge.net