9.1. Anableps from the command line

the Anableps application comes together with some other applications.

The main application is called anableps usually with the alias bleps in Linux systems.

This command-line app expects a command, possibly followed by arguments and parameters:

anableps <command> [arguments] [parameters]

Command can be one of:

  • run: runs a file
  • exec: executes what follows as Anableps code
  • example: writes an example in some directory, ready to be run.
  • help: returns help on some topic.
  • getparam: displays the value of a configuration parameter.
  • setparam: sets a configuration parameter.
  • slave: starts Anableps in slave mode.
  • interactive3: starts the interactive interface for 3D
  • interactive2: starts the interactive interface for 2D

9.1.1. Commands in detail

All commands can take a number of arbitrary parameters. Parameters can be fed in following the standard for Posix systems (see [RAY2] )

  • -verbose: sets the level of verbosity. Allowed values are 0, 1, 2 and 3.

9.1.1.1. Command run

This is the default command. If no command given the first parameter is taken as the name of a file to be executed [1]

bash> bleps myfile.bleps
... executes myfile.bleps

bash> bleps runexample reference.example90
... runs the example

bash> bleps run help
... executes the file called "help"

Parameters:

  • -debug: sets the debug level
  • -parallel=[true|false] allows/forbids parallel processing, no matter what is intended in the code. If set to false, recruiting workers will always fail

9.1.1.2. Commands example and run_example

The command example writes the selected example to a directory. The command run_example runs the example without writing it to a file.

Example names are given for each snippet in this reference. To get them, prepend the prefix ref:

bleps example ref.code32  ./exampleDir

There are other namespaces for other documentation. In particular, the technical specifications use the prefix tech:

bleps example tech.ref3

9.1.1.3. Command help

Returns help about some topic:

bash> bleps help bezier
... returns help ...

If you want to open the html help, type:

bash> bleps help html

9.1.1.4. Commands getParam and setParam

The application is configured by a set of parameters. See appendix5 for a comprehensive list of all the parameters:

bash> setParam render.vectorial.maxIterations 34

setParam affects to the defaults??? TO WHAt???

9.1.1.5. Command worker

This command starts Anableps in worker mode. When Anableps starts in worker mode, does not process any input, but listens to port xxxx for work package requests(s) from the master.

Parameters:

  • tags: publish a series of tags according to which it can be recruited or
  • allowip: accepts only
  • banip: bans some ips
  • allowtag: when inquired by some host that publishes that tag, accept it
  • bantag:

Example:

bash> bleps worker -banip 161.111.*.*  -bantag -accepttag

9.1.1.6. Command interactive

Opens the interactive console.

9.1.1.7. Commands execute (x)

Takes the rest of the command line as Anableps code and execute it. The alias blex is the same as bleps x

Note even if using blepx or blep x , objects created are retained in memory among invocations in the shell. Things like the following are ok:

bash> bleps x cube c: size 20 cm
bash> bleps x cube d: size 30 cm
bash> bleps x place c besides d
bash> bleps print
...(prints the scene to the file output.png)

You can always reset all that working memory with bleps x reset

9.1.1.8. Command console

Opens a console, so you don’t have to type-in bleps all the time in the shell. The example above would go like:

bash> bleps console
----------------------------------
Anableps v2.0 interactive console
(c) 2021 Angel Perea
----------------------------------
> cube c: size 20cm
> cube d: size 30cm
> place c besides d
> print: .output output2.png
> ^D
bash>

9.1.1.9. Command usage

Displays a quick usage cheatsheet for Anableps

9.1.1.10. Command tricks

Displays a selection of tricks

9.1.1.11. Command contrib

Displays the list of contributors?

9.1.1.12. Command license / licence

Displays the current license for Anableps: the GNU GPL v3

9.2. Configuration

Several aspects of Anableps are commanded by configuration variables. Those variables are hierarchically stored with composite names using dots (.) as separator.

There is not one but three different configuration files that are looked sequentially to get a configuration values. As soon as one value is found in one of them, thats the one used so, in the following list shows the precedence of the files.

  1. First the system looks if there is any option explicitly declared in the command line with -setopt. In the following example maxthreads is set to one:

    bash> anableps run myfile.bleps -setopt app.maxthreads 1
    
  2. Then, the runtime looks for any file in the directory of the file being executed or the project directory (if executing a project), named anableps.conf. this filename can be changed by the command line with the option -confFile. In that case Anableps will look there for the configuration file

  3. If not yet found, Anableps looks into <userdir>/.anableps/anableps.conf ( C:\Users\Username\anableps.conf in windows systems, and /Users/userName/Library/Preferences/anableps.conf in macos systems), if they exist, where the defaults for the user are kept [2].

  4. After that, /etc/anableps/anableps.conf is read (C:\Program Files\Common Files\anableps.conf for windows and /Library/Preferences/anableps.conf for macos): There is where the default options for the whole system are kept.

  5. In the case that after all that search, the value for the configuration variable has not been found yet, Anableps will use its own internal default value. However, it will issue a warning, as the configuration file at /etc/ should be complete.

To get a list of all the values see list of configuration parameters

  • Note: This being said, that is how the script starts. At any point during the execution of the script, the current values of the configuration variables can be changed using setOpt commands and this, of course, changes everything being previously set.

Footnotes

[1]Note that if a file is called “run”, “example” or the name of some command, it can be still be executed by using bleps run [filename]`. This is of course recommended for batch operation, as the name of the file is not known in advance.
[2]see https://softwareengineering.stackexchange.com/questions/299869/where-is-the-appropriate-place-to-put-application-configuration-files-for-each-p