diff options
-rw-r--r-- | utils/cli/ledgersmb_cli.pl | 10 | ||||
-rw-r--r-- | utils/cli/sample.lsmb | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/utils/cli/ledgersmb_cli.pl b/utils/cli/ledgersmb_cli.pl index d279e958..39d550e7 100644 --- a/utils/cli/ledgersmb_cli.pl +++ b/utils/cli/ledgersmb_cli.pl @@ -30,8 +30,8 @@ $form = new Form; $syntax = << '_END_SYNTAX_'; KEY : /\w[a-z0-9_]*/i - MODSTR : /\w[a-z0-9_]*/i - FNKEY : /(?:\w|:)+/ + MODSTR : /\w[a-z0-9_:]*/i + FNKEY : /(?:\w|:|\-\>)+/ OP : m([-+*/%]) NUMBER : /[+-]?\d*\.?\d+/ @@ -51,7 +51,7 @@ $syntax = << '_END_SYNTAX_'; { main::call_and_assign($item{FNKEY}, $item{ARGSTR}, $item{KEY}) } FUNCTIONCALL : /call/i FNKEY '(' ARGS ')' - { main::call($item{FNKEY}, $item{ARGS})} + { main::call($item{FNKEY}, $item{ARGS});} for : /for/i KEY { main::push_loop($item{KEY}) } @@ -112,7 +112,7 @@ sub call { $argstr =~ s/form/\\\%\$form/; $argstr =~ s/user/\\\%myconfig/; my @args = split /,\s/, $argstr; - return $call(@args); + eval "$call($argstr);\n" || print STDERR $@ . "\n"; } sub call_and_assign { @@ -149,7 +149,7 @@ sub login { sub load_mod { my $mod = shift; $mod =~ s/::/\//; - eval { require "$mod.pm"; }; + require "$mod.pm";; } my $scriptparse = new Parse::RecDescent($syntax); diff --git a/utils/cli/sample.lsmb b/utils/cli/sample.lsmb index 6344c89f..9e544b4e 100644 --- a/utils/cli/sample.lsmb +++ b/utils/cli/sample.lsmb @@ -2,5 +2,8 @@ ENV:PGUSER = postgres # how to set an environment variable login = demo # How to set a form variable password = demo LOGIN # Log in -MODULE AR # Load a module -CALL AR::transactions(form, user) # call a function +MODULE LedgerSMB::CT # Load a module +id = 10139 +vc = customer +db = customer +CALL CT->create_links(user, form) # call a function |