summaryrefslogtreecommitdiff
path: root/utils/cli
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-01 04:49:28 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-01 04:49:28 +0000
commit2bebecbfe9d4d85e79e5be176bcaa83890c7984f (patch)
treeca8d563fd2a3043800138655505edae58d8d6943 /utils/cli
parentb2b02c07bf6e37c45bcb72d6414a2e1c16313251 (diff)
Adding outline of an experimental CLI wrapper
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@445 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'utils/cli')
-rw-r--r--utils/cli/ledgersmb_cli.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/cli/ledgersmb_cli.pl b/utils/cli/ledgersmb_cli.pl
new file mode 100644
index 00000000..72e4e2f7
--- /dev/null
+++ b/utils/cli/ledgersmb_cli.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+# This is a simple wrapper that allows you to write simple scripts with LSMB
+# See sample for the file format.
+
+use LedgerSMB::User;
+use LedgerSMB::Form;
+use LedgerSMB::Sysconfig;
+
+$form = new Form;
+
+while ($line = <>){
+ if ($line =~ /^\s*CALL (.+) INTO (.+)/){
+ $form->{$2} = %${$1};
+ } elsif ($line =~ /^\s*MODULE (.+)/){
+ } elsif ($line =~ /^\s*ENV:(.+)\s*=\s*(.*)/){
+ } elsif ($line =~ /^\s*(.+)\s*=\s*(.+)/){
+ } else {
+ die "Parse error in script file: $line";
+ }
+}