slogan program provide a unified interface for accessing the Slogan interpeter, REPL and compiler.
This program accept many command line options. This chapter document these options in detail.
slogan command can be invoked in two ways as shown below:
$ slogan <options>
This will start the interactive REPL where you can interpret programs.
$ slogan <options> script
This will execute or compile a slogan script, depending on the options passed.
Valid options are:
| ||Execute a script.|
| ||Compile a script into a dynamically loadable object file.|
| ||Compile a script into an executable binary.|
| ||Install a package.|
| ||Uninstall a package.|
| ||Additional options that will be passed to the system linker.|
| ||Additional options that will be passed to the system C compiler.|
| ||Launch REPL after performing other options.|
| ||Display version information and quit.|
| ||Print this help and quit.|
Some of the options like
-i take additional arguments. They are illustrated below:
# install a package from a local folder or compressed archive (a .zip, .tar.gz or a .tar.bz2 file). $ slogan -i "package_name,local,/path_to_package_folder_or_archive" # install a package from a git repository. $ slogan -i "package_name,git,https://github.com/gitusername/package_name.git" # install a package hosted on a remote server. $ slogan -i "package_name,remote,http://slogan-packages.com/package_name.tar.gz" # uninstall a package. $ slogan -u "package_name"
You can install and uninstall packages from within a program as well. This is accomplished by calling the
Slogan programs runs on top of Gambit Scheme. Options meant for the Gambit
virtual machine can also be passed as command line arguments for
slogan. These options must be preceded by
-: and each
option must be separated by comma. The most useful options accepted by the virtual machine is given below:
| ||The minimum heap size in kilobytes.|
| ||The maximum heap size in kilobytes.|
| ||The heap live ratio after GC in percent.|
| ||Set standard input and output options; see below for OPT.|
OPT should be one of:
| ||Character encoding (ASCII|ISO-8859-1|UCS-2/4|UTF-16/8|UTF).|
| ||End-of-line encoding (LF|CR|CR-LF).|
| ||Buffering (unbuffered|newline buffered|fully buffered).|
| ||Enable character encoding errors (on|off).|
| ||Enable line-editing (on|off), for terminals only.|
Here are a few examples of passing command-line options to the VM:
# Evaluate a script after setting minimum heap-size of 500MB and maximum heap-size to 2GB: $ slogan -:m500000,h2000000 -e script.sn # Prepare the interpreter to read/write UTF-8 encoded files: $ slogan -:-8 slogan> load("utf8_encoded_source_code.sn")
A standalone Slogan program can accept all VM options in addition to its own command line arguments.
For a full list of virtual machine command line arguments, run,
$ slogan -h
Previous | Contents