Subversion Repositories havirt

Rev

Rev 35 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26 rodolico 1
### Programming
2
 
3
This document is for programmers who want to make changes to the code, or
4
just want to know how it all works. If you find something you want to fix,
5
we will be glad to add it to the system if you supply a diff.
6
    svn diff filename > filename.diff
7
You can contact us by going to https://www.dailydata.net/contactus
8
 
9
### Overview
10
 
11
havirt is a complicated file in that I did a bunch of weird stuff in, and it
12
should be explained in the internal documentation. The basic idea is you
13
call havirt with two positional parameters, which is translated internally
14
to a module name and a sub (function) in that module.
15
 
16
Command line flags are processed first, and any additional parameters are
17
passed on the stack to the called function.
18
 
19
The function does something, then returns a string which is displayed on the 
20
screen (unless the --quiet flag was passed).
21
 
22
So, for example. 
23
    havirt domain list
24
loads domain.pm, and executes the list function inside, displaying whatever
25
is returned by sub list.
26
    havirt node scan node1 node2
27
loads node.pm, calls the scan function, with two parameters (node1, node2)
28
on the stack (@_)
29
 
30
havirt.pm is loaded in the **main** namespace, so it contains functions
31
which are common to all modules.
32