Woosh

A wonderful object-oriented shell environment

Description

Woosh is a really useless attempt at building an object-oriented shell during just one afternoon while avoiding any real programming. The idea is quite simple:

Great Features

Download

Please download the tar ball from the sourceforge project page.

Install

Unpack the tar ball wherever you like. Just to be sure have a look at install_woosh, then call it with the directory prefix where you want to install woosh as an argument (e.g. 'install_woosh /usr/local' or 'install_woosh $HOME'). Be sure to use full path names otherwise it probably won't work (woosh relies heavily on absolute paths). Set the env variable O_BASE to the directory you called install_woosh with.
Now you have a working woosh system, consisting of the two classes Object and Class (sitting in $PREFIX/lib/woosh) and a shell script, call (in $PREFIX/bin).

Usage

Calling Methods

The main functionality provided by woosh is a way to call methods on objects. This is provided by the script call, which is used as follows:

> call object method [args...]

Where object is a directory supporting the woosh notion of objects and method is an executable lying either in the object itself or in one of the classes comprising its super-class hierarchy. Because classes themselves are objects class methods are just a natural extension of this structure.
Currently there are three pre-defined methods coming with woosh (all defined in Object):

Creating new classes

New classes can be created by calling derive on a class object. Note that all classes lying in $O_BASE will be found automatically and don't need to be pointed at explicitly. derive takes one parameter which is the name of the new class.

Writing methods

Methods are just ordinary executables located in a way that they can be detected by the runtime system. Nevertheless there are some points to note:

Programming with woosh

  1. use Derive to create many new classes
  2. add some scripts or programs to those classes (by copying them into the class directories)
  3. perhaps add some constructors (don't forget to call Super Create)
  4. create many nice objects und use them

How it works

It's really simple:
Objects are directories containing a link ._ pointing at their class, classes are objects containing a link Super pointing at their super-class. Everything else is done by call. It basically adds all relevant directories in the right order to the path and then executes the method as an ordinary shell command with all remaining arguments in the command line.

Possible future work

Well, probably I will be too lazy for this. Nevertheless, have fun with woosh!