NAME
Zoidberg::History - History plugin for the Zoidberg shell
SYNOPSIS
This module is a Zoidberg plugin, see Zoidberg::Fish for details.
ABSTRACT
This module provides history functionality for
the zoidberg shell.
DESCRIPTION
This module provides history functionality for the zoidberg shell. It is a core plugin.
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
- add_dir($dir)
-
Add a dir to directory history.
- get_dir($action)
-
Get a dir from directory history. Action can be 'forw' or 'back'.
AUTHOR
Jaap Karssenberg || Pardus [Larus] <j.g.karssenberg@student.utwente.nl> R.L. Zwart, <carlos@caremail.nl>
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.