diff options
-rw-r--r-- | utils/cli/ledgersmb_cli.pl | 18 | ||||
-rw-r--r-- | utils/cli/sample.lsmb | 9 |
2 files changed, 18 insertions, 9 deletions
diff --git a/utils/cli/ledgersmb_cli.pl b/utils/cli/ledgersmb_cli.pl index b689b68d..82a9785b 100644 --- a/utils/cli/ledgersmb_cli.pl +++ b/utils/cli/ledgersmb_cli.pl @@ -29,23 +29,31 @@ $form = new Form; while ($line = <>){ $line =~ s/#.*//; # strip out comments - if ($line =~ /^\s*CALL (.+) INTO (.+)/){ + if ($line =~ /^\s*CALL\s+(.+)\s+INTO\s+(.+)/i){ $form->{$2} = &{$1}(\%$form); - } elsif ($line =~ /^\s*MODULE (.+)/){ + } elsif ($line =~ /^\s*MODULE (.+)/i){ $module = $1; $module =~ s/::/\//; eval { require $module; }; - } elsif ($line =~ /^\s*ENV:(.+)\s*=\s*(.*)/){ + } elsif ($line =~ /^\s*ENV:(.+)\s*=\s*(.*)/i){ + my ($key, $value) = ($1, $2); + $key =~ s/\s?(.*)\s?/$1/; + $value =~ s/\s?(.*)\s?/$1/; $ENV{$1} = $2; } elsif ($line =~ /^\s*(.+)\s*=\s*(.+)/){ $form->{$1} = $2; - } elsif ($line =~ /^\s*CALL (.+)/){ - {$1}(\%$form); + } elsif ($line =~ /^\s*CALL\s+(.+)/i){ + {$1}; + } elsif ($line =~ /^\s*LOGIN\s*/i){ + $myconfig = new LedgerSMB::User + "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}"; } elsif ($line !~ /^\s*$/) { die "Parse error in script file: $line"; } } +delete $form->{password}; + for (keys %$form){ print "$_ = $form->{$_}\n"; } diff --git a/utils/cli/sample.lsmb b/utils/cli/sample.lsmb index 05650f97..62b67fb0 100644 --- a/utils/cli/sample.lsmb +++ b/utils/cli/sample.lsmb @@ -1,6 +1,7 @@ # THe below line shows how to set the PGUSER environment variable -ENV:PGUSER = postgres -user = demo # set username -password = demo # set password +ENV:PGUSER=postgres +login=demo # set username +password=demo # set password +LOGIN MODULE AR # load AR -CALL AR::transactions +CALL AR::transactions(\%$form); |