From 987e2a6ea588c1aa1bb48ca562742f42c7e9fe27 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 1 Nov 2006 05:05:19 +0000 Subject: 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 --- utils/cli/ledgersmb_cli.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'utils') 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"; +} -- cgit v1.2.3