Rev 35 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
### Programming
This document is for programmers who want to make changes to the code, or
just want to know how it all works. If you find something you want to fix,
we will be glad to add it to the system if you supply a diff.
svn diff filename > filename.diff
You can contact us by going to https://www.dailydata.net/contactus
### Overview
havirt is a complicated file in that I did a bunch of weird stuff in, and it
should be explained in the internal documentation. The basic idea is you
call havirt with two positional parameters, which is translated internally
to a module name and a sub (function) in that module.
Command line flags are processed first, and any additional parameters are
passed on the stack to the called function.
The function does something, then returns a string which is displayed on the
screen (unless the --quiet flag was passed).
So, for example.
havirt domain list
loads domain.pm, and executes the list function inside, displaying whatever
is returned by sub list.
havirt node scan node1 node2
loads node.pm, calls the scan function, with two parameters (node1, node2)
on the stack (@_)
havirt.pm is loaded in the **main** namespace, so it contains functions
which are common to all modules.