[Gretl-devel] new command line options

Allin Cottrell cottrell at wfu.edu
Fri Jul 17 12:18:13 EDT 2009


In testing various gretl features using gretlcli I've sometimes
wished for a way of setting a value within a script automatically
via the command line (i.e. without having to edit the script).
One can do that via environment variables, given gretl's getenv()
function, but this can be a bit clunky.

There's now a new command-line option "--switch=<value>".
An integer value registered in this way is accessible via
the internal variable $switch.

In addition, since we have the GUI language selector now, the
option -q or --basque seems redundant; now -q is paired with
--quiet and gives less verbose program information on start-up.

Illustration:

waverley:~$ cat switch.inp
scalar uselib = $switch

waverley:~$ gretlcli -b switch.inp -q
gretl version 1.8.2cvs
Current session: 2009-07-17 12:13
? run switch.inp
 /home/cottrell/switch.inp
? scalar uselib = $switch
Generated scalar uselib = 0
Done
waverley:~$ gretlcli -b switch.inp -q --switch=3
gretl version 1.8.2cvs
Current session: 2009-07-17 12:13
? run switch.inp
 /home/cottrell/switch.inp
? scalar uselib = $switch
Generated scalar uselib = 3
Done

Allin


More information about the Gretl-devel mailing list