summaryrefslogtreecommitdiff
path: root/utils/cli
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-01 05:05:19 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-01 05:05:19 +0000
commit987e2a6ea588c1aa1bb48ca562742f42c7e9fe27 (patch)
tree41aa61544776ac2f33623575c76ef30552113162 /utils/cli
parent2bebecbfe9d4d85e79e5be176bcaa83890c7984f (diff)
More on the cli script wrapper
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@446 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'utils/cli')
-rw-r--r--utils/cli/ledgersmb_cli.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/utils/cli/ledgersmb_cli.pl b/utils/cli/ledgersmb_cli.pl
index 72e4e2f7..1dbbf2fa 100644
--- a/utils/cli/ledgersmb_cli.pl
+++ b/utils/cli/ledgersmb_cli.pl
@@ -10,12 +10,24 @@ use LedgerSMB::Sysconfig;
$form = new Form;
while ($line = <>){
+ $line =~ s/#.*//; # strip out comments
if ($line =~ /^\s*CALL (.+) INTO (.+)/){
- $form->{$2} = %${$1};
+ $form->{$2} = &{$1}(\%$form);
} elsif ($line =~ /^\s*MODULE (.+)/){
+ $module = $1;
+ $module =~ s/::/\//;
+ eval { require $module; };
} elsif ($line =~ /^\s*ENV:(.+)\s*=\s*(.*)/){
+ $ENV{$1} = $2;
} elsif ($line =~ /^\s*(.+)\s*=\s*(.+)/){
- } else {
+ $form->{$1} = $2;
+ } elsif ($line =~ /^\s*CALL (.+)/){
+ &{$1}(\%$form);
+ } elsif ($line !~ /^\s*$/) {
die "Parse error in script file: $line";
}
}
+
+for (keys %$form){
+ print "$_ = $form->{$_}\n";
+}