arrow-left

All pages
gitbookPowered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Options (up to vs. 3.17.4)

Command-line options are used to tell the ampersand compiler what to do. This page lists the available options.

Some of the options are still experimental. Momentarily an effort is made to rationalize the options, so this may change at some point in the near future.

Since Ampersand-v3.5.3, it is possible to use a configuration file, reducing the need to rewrite the same options every time you use ampersand.exe. A configuration file can be used using the --config option.

This text may deviate slightly from the Ampersand version you are running, especially as new options are introduced. The command ampersand --help will give you the actual list.

hashtag
-h, -?, --help

Print a usage message briefly summarizing the most common command-line options and the bug-reporting address, then exit. When used in combination with --verbose, it shows all command-line options. Use this to get the actual list of options of your Ampersand compiler.

hashtag
-V, --version

Print the version number of Ampersand to the standard output stream. Please mention this information in every bug report you submit (see below).

hashtag
Other options

hashtag
--ECA

generate documentation with ECA rules.

hashtag
--add-semantic-metamodel

The metamodel in Formal-ampersand is loaded together with your own model. Use this feature in conjunction with --meta-tables to get a metamodel populated with your own script into the database.

hashtag
--altGraphics

generate graphics in an alternate way. (you may experiment with this option to see the differences for yourself)

hashtag
--atlas-without-terms

Temporary option to create an Atlas without terms. This feature is used in RAP3 for performance reasons.

hashtag
--blackWhite

do not use colors in generated graphics. Use this feature if you must print in black and white, to obtain better results than printing a colored source on a black-and-white printer.

hashtag
--config=config.yaml

By default, the Ampersand compiler looks in the working directory for a config file (.yaml) with the same filename as the Ampersand script. Use this feature to redirect to another file. Use --sampleConfigFile to get a template.

hashtag
--crowfoot

generate crowfoot notation in conceptual models. This is used to better match the preferences of some database engineers in the generated documentation.

hashtag
--crud-defaults=CRUD

Set the default CRUD function for services. This function is explained in . This feature is used temporarily to gain experience with CRUD and learn about its semantics.

hashtag
--customizations=DIRECTORY [, DIRECTORY]*

copy one or more directories into the generated prototype. This overrules the default directory, which is called customizations.

hashtag
--dbName=NAME (-d)

database name. Use this for choosing the name of the SQL database. This overrules the environment variable CCdbName. It defaults to the filename of your Ampersand script.

hashtag
--dev, --ignore-invariant-violations

Allow building a prototype, even if there are invariants that are being violated. (See on Github)

hashtag
--diagnosis

diagnose your Ampersand script. Use this if you wish to generate a document containing only the diagnosis chapter.

hashtag
--do-not-trim-cellvalues

Do not ignore leading and trailing spaces in .xlsx files that are INCLUDED in the script. Normally, Ampersand removes spaces around cell values in .xlsx files when transforming the cell value to atoms. Use this to enforce that spaces around cell values are meaningful.

hashtag
--export[=file] (-e)

export as plain Ampersand script.

hashtag
--force-reinstall-framework

re-install the prototype framework. This discards any previously installed version. Use this to eradicate any doubt about a fresh reinstall.

hashtag
--fpa

Generate Function Point Analysis chapter. Use this to include a measure of the functional complexity (size) of the generated application into your functional specification document. This feature is currently out of order.

hashtag
--fpa-excel

generate an Excel workbook (FPA_<filename>.xml). Use this to obtain the base data used in the function point analysis. This feature is currently out of order.

hashtag
--fspec=FORMAT (-f)

generate a functional design document in specified output format (FORMAT=[Asciidoc, Context, Docbook, Docx, Html, Latex, Man, Markdown, Mediawiki, Opendocument, Org, Pandoc, Pdf, Plain, Rst, Rtf, Texinfo, Textile]). Use this to obtain documentation in the format of your own choice.

hashtag
--gen-as-rap-model

generate populations for use in RAP3.

hashtag
--haskell

generate internal data structure, written in Haskell. Use this for debugging.

hashtag
--help (-h, -?)

get (this) usage information.

hashtag
--services (-x)

generate services. This feature does not work properly at the moment.

hashtag
--language=LANG

Pick 'NL' for Dutch or 'EN' for English, as the language to be used in your output. Without this option, the output is written in the language of your context. Text snippets in other languages than the one specified are ignored. Use this to get a functional specification in the language of your choice.

hashtag
--meta-file

Generate a .adl file that contains the relations of formal-ampersand, populated with the meta-population of your own .adl model.

hashtag
--meta-tables

Populate the metamodel of Ampersand with the contents of your own script. Use this feature in conjunction with --add-semantic-metamodel to get a metamodel populated with your own script into the database. This is used for higher-order purposes, specifically in RAP3.

hashtag
--namespace=NAMESPACE

prefix database identifiers with this namespace, in order to isolate namespaces within the same database. This feature was used in RAP2 to isolate students' work in separate tables.

hashtag
--newNormalizer

Use the new optimizer at your own risk. Used for research purposes.

hashtag
--noDiagnosis

omit the diagnosis chapter from the functional design document.

hashtag
--noGraphics

omit the generation of graphics during the generation of the functional design document.

hashtag
--oldNormalizer

use the old optimizer at your own risk. Used for research purposes.

hashtag
--outputDir=DIR (-o)

output directory. Use this if you want the Ampersand compiler to redirect the output to a location of your choice. This overrules the environment variable CCdirOutput.

hashtag
--pop-xlsx

Generate a .xmlx file containing the populations of your script. Meant to be used as an Excel-file in which you can add bulk data and reuse that for loading the data into your application.

hashtag
--proofs

generate derivations in HTML-format. Use this to see how Ampersand derives computer instructions from your rules.

hashtag
--proto[=DIRECTORY] (-p)

generate an information system. Use this to verify your analysis or to obtain a working prototype from your Ampersand script. In some cases, the result will be good enough for production. This option overrules the environment variable CCdirPrototype.

hashtag
--prototype-framework-version=VERSION

tag, branch or SHA of the prototype framework on Github. Use this to select a specific version when generating an information system.

hashtag
--reference-table

generate a table of references in the Natural Language chapter, for instance for legal traceability.

hashtag
--sampleConfigFile

write a sample configuration file (sampleconfig.yaml). Use this to save yourself the trouble of looking up an example configuration file.

hashtag
--sql-bin-tables

generate binary tables only in the SQL database. Use this to verify that the generated system works with binary tables as well as with wide tables.

hashtag
--sqlHost=HOSTNAME

set SQL hostname (Defaults to `localhost`). Use this to let the generated system know which database to connect to.

hashtag
--sqlLogin=USER

set SQL user name (Defaults to `ampersand`). Use this to let the generated system log into the database.

hashtag
--sqlPwd=PASSWORD

set SQL password (Defaults to `ampersand`). Use this to let the generated system log into the database.

hashtag
--sqldump

generate a dump of SQL queries. Use this for debugging purposes.

hashtag
--test

Used for test purposes only.

hashtag
--testRule=RULE

Show contents and violations of specified rules. Use this for diagnostic purposes.

hashtag
--uml

Use this to generate conceptual models as a UML 2.0 data model.

hashtag
--validate

Compare results of rule evaluation in Haskell and SQL. Use this to debug the SQL code generator to validate the meaning of all rules, which are evaluated both in the compiler and in the database. This option requires command-line PHP with MySQL support.

hashtag
--verbose (-V)

run the compiler in verbose mode. Use this for diagnostic purposes.

hashtag
--version (-v)

show version and exit. Please use this when reporting bugs on .

interface terms
issue 728arrow-up-right
Githubarrow-up-right

Configuration

You configure the precise actions of the compiler by specifying on the command line. If you use the same configuration frequently, consider using a configuration file, so you don't have to remember all these options each time you call the compiler. The configuration file sits in the same directory as your model.

hashtag

Optionsarrow-up-right

Running the Ampersand compiler

If you want to check your script, generate documentation, generate prototypes or use any other feature of Ampersand, you need to run the Ampersand compiler. This page tells you how.

hashtag
Purpose

In many situations, you can avoid running the Ampersand compiler from the command line. For instance, by using a system such as RAParrow-up-right. However, in situations that you run Ampersand from the command line, this page is the place to be.

hashtag
Prerequisites

We assume you have docker running on your computer and that you are connected to the internet. In that case you don't have to install anything.

hashtag
COMMAND

The following is the base command on Linux (works for bash as well as zsh)

On the Windows-10 command-line this looks slightly different (todo: check this!)

This runs the Ampersand compiler (from your command prompt). The first time you do this, docker will take some time to download the images it needs.

hashtag
SYNOPSIS

In the sequel we will use ampersand as an alias for docker run -it -v "$(pwd)":/scripts ampersandtarski/ampersand

hashtag
DESCRIPTION

The command ampersand takes a file as input. It must contain a valid ampersand script, i.e. a script that complies to the and semantics of ampersand. The compiler will not generate any output unless the script is valid.

hashtag
Environment variables

The standard behavior of ampersand is affected by the following environment variables.

  • CCdbName Sets the name of the database that is to be generated. Can be overruled by --dbName

  • CCdirOutput Sets the default output directory for generated assets. Can be overruled by --outputDir

  • CCdirPrototype Sets the default directory where functional prototypes are being generated. Can be overruled by --proto

hashtag
EXAMPLES

hashtag
BUGS

We are happy to receive . However, please try to help us by first checking that it has not been reported already. You can do so by searching the issues. When in doubt however, don't hesitate to .

hashtag
Exit status

In case the Ampersand compiler is called by software and fails, it is useful to have an exit code to give some information about the nature of the failure. The Ampersand compiler :

The population would violate invariants. The compiler cannot generate a violation-free database.

30

Invalid SQL

An SQL query gives other results than the semantics of Ampersand prescribes. This should never occur, so please .

50

Ampersand violations

There are sanity checks on your script that have produced violations, so the compiler will not generate an application.

60

Composer

The installation of Composer failed, so the front-end application will not work. This is most likely a configuration error.

70

Wrong arguments

The command-line arguments by which the compiler was called contain errors. Inspect the compiler output for a diagnosis.

80

Back-end

The compiler failed to install the prototype framework. This is most likely a configuration error.

Code

Name

Meaning

0

Success

Compilation has terminated without failures

2

Fatal

This is a software error in the Ampersand compiler, that should never have occured in operational use. Please report an issuearrow-up-right.

10

Invalid

The script is not valid and the compiler has produced error messages to help you diagnose your mistake(s).

20

syntax
bug reports at AmpersandTarskiarrow-up-right
create a new issuearrow-up-right
produces the following exit codesarrow-up-right

Inconsistent

docker run -it -v $(pwd):/scripts ampersandtarski/ampersand
docker run -it -v $PWD:/scripts ampersandtarski/ampersand
docker run -it -v "$(pwd)":/scripts ampersandtarski/ampersand COMMAND [OPTIONS] FILE
ampersand documentation --format docx --verbose Hawaii.adl  # generates a specification document for Hawaii.adl
ampersand check Delivery.adl                                # just check Delivery.adl for errors
ampersand proto --proto-dir "D:\htdocs\CvM\" Contracts.adl  # generate a prototype from Contracts.adl and write the application to the specified directory.
ampersand --help
ampersand --help --verbose
ampersand --version
report an issuearrow-up-right

Commands (vs. 4.0.0 and later)

As from version 4.0.0 Ampersand has a command structure that allows you to use Ampersand from the command line.

hashtag
Commands without a script

  1. ampersand --version to find out which version of Ampersand you are using.

  2. ampersand --help to summarize all level one commands

hashtag
Commands with a script

In practice, run ampersand --help instead of consulting the following list, just to be sure that the commands match the version you are using. The following list has been taken from version 4.0.0.

The general structure of commands is ampersand [options]* COMMAND. The following commands are available:

  1. ampersand [options]* check <filename>

    Check your model for syntax errors and type errors.

  2. ampersand [options]* daemon <filename>

    Check your model continuously while editing it.

hashtag
Filename

The filename in a command typically has suffix .adl (which stands for Ampersand Description Language). If you omit the suffix .adl, Ampersand does NOT add it for you. The filename conventions of your operating system apply (whether you have Windows, macOS, or Linux).

hashtag
Options

You may use one of the first three options to specify how verbose your output will be. The other options can be used at random and mixed freely.

  1. --help Show the help text. This is always up to date with the version of the compiler you are running. So consider ampersand --help to be authoritative.

  2. --verbosity VERBOSITY

    Verbosity: silent, error, warn, info, debug

hashtag
Options per command

Every command can have options of its own. Use the command and add --help to see which command specific options there are.

Example:

ampersand [options]* data-analysis <filename>

Export a data model as a plain Ampersand script, for analyzing Excel data.

  • ampersand [options]* dev-output <filename>

    Generate some diagnostic files, intended for developers of Ampersand.

  • ampersand [options]* documentation <filename>

    Generate a functional design document, to kick-start your functional specification.

  • ampersand [options]* population <filename>

    Generate a .xmlx file containing the populations of your script.

  • ampersand [options]* proofs <filename>

    Generate a report containing proofs.

  • ampersand [options]* proto <filename>

    Generate a prototype from your specification.

  • ampersand [options]* export <filename>

    Generate a single .adl-file of your script (prettyprinted)

  • ampersand [options]* uml <filename>

    Generate a data model in UML 2.0 style.

  • ampersand [options]* validate <filename>

    Compare results of rule evaluation in Haskell and SQL, for testing expression semantics. This requires command line PHP with MySQL support.

  • ampersand [options]* test <filename>

    Run test suites in a given directory. This is meant to do regression testing during automatic build (e.g. Travis-ci)

  • -V, --verbose

    Enable verbose mode: verbosity level "debug"

  • --silent

    Enable silent mode: verbosity level "silent"

  • --[no-]time-in-log

    Enable/disable inclusion of timings in logs, for the purposes of using diff with logs (default: enabled)

  • --[no-]terminal

    Enable/disable overriding terminal detection in the case of running in a false terminal

  • --terminal-width INT

    Specify the width of the terminal, used for pretty-print messages

  • --outputDir DIR

    Specify the directory where your output will be written to.

  • documentation % ampersand documentation --help
    Usage: ampersand documentation [--blackWhite] [--[no-]Intro] [--[no-]SharedLang]
                                   [--[no-]Diagnosis] [--[no-]ConceptualAnalysis] 
                                   [--[no-]DataAnalysis] [--[no-]graphics] 
                                   [--[no-]text] --format FORMAT AMPERSAND_SCRIPT 
                                   [--sql-bin-tables] [--interfaces] 
                                   [--namespace NAMESPACE] [--crud-defaults CRUD] 
                                   [--[no-]trim-cellvalues] [--build-recipe RECIPE] 
                                   [--ignore-invariant-violations] 
                                   [--language OUTPUTLANGUAGE] [--[no-]legal-refs] 
                                   [--verbosity VERBOSITY | (-v|--verbose) | 
                                     --silent] [--[no-]time-in-log] 
                                   [--[no-]terminal] [--terminal-width INT] 
                                   [--output-dir DIR] [--help]
      Generate a functional design document, to kick-start your functional
      specification.
    
    Available options:
      --blackWhite             avoid coloring conventions to facilitate readable
                               pictures in black and white.
      --[no-]Intro             Do or do not include chapter Intro in the generated
                               document.
      --[no-]SharedLang        Do or do not include chapter SharedLang in the
                               generated document.
      --[no-]Diagnosis         Do or do not include chapter Diagnosis in the
                               generated document.
      --[no-]ConceptualAnalysis
                               Do or do not include chapter ConceptualAnalysis in
                               the generated document.
      --[no-]DataAnalysis      Do or do not include chapter DataAnalysis in the
                               generated document.
      --[no-]graphics          Enable/disable generation of graphics before
                               generating the document. (default: enabled)
      --[no-]text              Enable/disable generation the document file.
                               (default: enabled)
      --format FORMAT          The format in which the output is written.
      AMPERSAND_SCRIPT         The root file of your Ampersand model.
      --sql-bin-tables         Generate binary tables instead of broad tables in SQL
                               database, for testing purposes.
      --interfaces             Generate interfaces, which currently does not work.
      --namespace NAMESPACE    Prefix database identifiers with this namespace, to
                               isolate namespaces within the same
                               database. (default: "")
      --crud-defaults CRUD     Temporary switch to learn about the semantics of crud
                               in interface expressions. (default: "CRUD")
      --[no-]trim-cellvalues   Enable/disable ignoring the leading and trailing
                               spaces in .xlsx files that are INCLUDED in the
                               script. (default: enabled)
      --build-recipe RECIPE    Build the internal FSpec with a predefined recipe.
                               Allowd values are:
                               [Standard,Grind,Prototype,RAP] (default: "Standard")
      --ignore-invariant-violations
                               ignore invariant violations. In case of the prototype
                               command, the generated prototype might not behave as
                               you expect. Documentation is not affected. This means
                               that invariant violations are reported anyway. (See
                               https://github.com/AmpersandTarski/Ampersand/issues/728)
      --language OUTPUTLANGUAGE
                               Pick 'NL' for Dutch or 'EN' for English, as the
                               language to be used in your output. Without this
                               option, output is written in the language of your
                               context.
      --[no-]legal-refs        Enable/disable generation of a table of legal
                               references in Natural Language chapter of the output
                               document. (default: disabled)
      --verbosity VERBOSITY    Verbosity: silent, error, warn, info, debug
      -v,--verbose             Enable verbose mode: verbosity level "debug"
      --silent                 Enable silent mode: verbosity level "silent"
      --[no-]time-in-log       Enable/disable inclusion of timings in logs, for the
                               purposes of using diff with logs (default: enabled)
      --[no-]terminal          Enable/disable overriding terminal detection in the
                               case of running in a false terminal
      --terminal-width INT     Specify the width of the terminal, used for
                               pretty-print messages
      --output-dir DIR         Specify the directory where your output will be
                               written to
      --help                   Show this help text