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.

Commands without a script

  1. 1.
    ampersand --version to find out which version of Ampersand you are using.
  2. 2.
    ampersand --help to summarize all level one commands

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. 1.
    ampersand [options]* check <filename>
    Check your model for syntax errors and type errors.
  2. 2.
    ampersand [options]* daemon <filename>
    Check your model continuously while editing it.
  3. 3.
    ampersand [options]* data-analysis <filename>
    Export a data model as a plain Ampersand script, for analyzing Excel data.
  4. 4.
    ampersand [options]* dev-output <filename>
    Generate some diagnostic files, intended for developers of Ampersand.
  5. 5.
    ampersand [options]* documentation <filename>
    Generate a functional design document, to kick-start your functional specification.
  6. 6.
    ampersand [options]* population <filename>
    Generate a .xmlx file containing the populations of your script.
  7. 7.
    ampersand [options]* proofs <filename>
    Generate a report containing proofs.
  8. 8.
    ampersand [options]* proto <filename>
    Generate a prototype from your specification.
  9. 9.
    ampersand [options]* export <filename>
    Generate a single .adl-file of your script (prettyprinted)
  10. 10.
    ampersand [options]* uml <filename>
    Generate a data model in UML 2.0 style.
  11. 11.
    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.
  12. 12.
    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)

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).

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. 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. 2.
    --verbosity VERBOSITY
    Verbosity: silent, error, warn, info, debug
  3. 3.
    -V, --verbose
    Enable verbose mode: verbosity level "debug"
  4. 4.
    --silent
    Enable silent mode: verbosity level "silent"
  5. 5.
    --[no-]time-in-log
    Enable/disable inclusion of timings in logs, for the purposes of using diff with logs (default: enabled)
  6. 6.
    --[no-]terminal
    Enable/disable overriding terminal detection in the case of running in a false terminal
  7. 7.
    --terminal-width INT
    Specify the width of the terminal, used for pretty-print messages
  8. 8.
    --outputDir DIR
    Specify the directory where your output will be written to.

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:
1
documentation % ampersand documentation --help
2
Usage: ampersand documentation [--blackWhite] [--[no-]Intro] [--[no-]SharedLang]
3
[--[no-]Diagnosis] [--[no-]ConceptualAnalysis]
4
[--[no-]DataAnalysis] [--[no-]graphics]
5
[--[no-]text] --format FORMAT AMPERSAND_SCRIPT
6
[--sql-bin-tables] [--interfaces]
7
[--namespace NAMESPACE] [--crud-defaults CRUD]
8
[--[no-]trim-cellvalues] [--build-recipe RECIPE]
9
[--ignore-invariant-violations]
10
[--language OUTPUTLANGUAGE] [--[no-]legal-refs]
11
[--verbosity VERBOSITY | (-v|--verbose) |
12
--silent] [--[no-]time-in-log]
13
[--[no-]terminal] [--terminal-width INT]
14
[--output-dir DIR] [--help]
15
Generate a functional design document, to kick-start your functional
16
specification.
17
18
Available options:
19
--blackWhite avoid coloring conventions to facilitate readable
20
pictures in black and white.
21
--[no-]Intro Do or do not include chapter Intro in the generated
22
document.
23
--[no-]SharedLang Do or do not include chapter SharedLang in the
24
generated document.
25
--[no-]Diagnosis Do or do not include chapter Diagnosis in the
26
generated document.
27
--[no-]ConceptualAnalysis
28
Do or do not include chapter ConceptualAnalysis in
29
the generated document.
30
--[no-]DataAnalysis Do or do not include chapter DataAnalysis in the
31
generated document.
32
--[no-]graphics Enable/disable generation of graphics before
33
generating the document. (default: enabled)
34
--[no-]text Enable/disable generation the document file.
35
(default: enabled)
36
--format FORMAT The format in which the output is written.
37
AMPERSAND_SCRIPT The root file of your Ampersand model.
38
--sql-bin-tables Generate binary tables instead of broad tables in SQL
39
database, for testing purposes.
40
--interfaces Generate interfaces, which currently does not work.
41
--namespace NAMESPACE Prefix database identifiers with this namespace, to
42
isolate namespaces within the same
43
database. (default: "")
44
--crud-defaults CRUD Temporary switch to learn about the semantics of crud
45
in interface expressions. (default: "CRUD")
46
--[no-]trim-cellvalues Enable/disable ignoring the leading and trailing
47
spaces in .xlsx files that are INCLUDED in the
48
script. (default: enabled)
49
--build-recipe RECIPE Build the internal FSpec with a predefined recipe.
50
Allowd values are:
51
[Standard,Grind,Prototype,RAP] (default: "Standard")
52
--ignore-invariant-violations
53
ignore invariant violations. In case of the prototype
54
command, the generated prototype might not behave as
55
you expect. Documentation is not affected. This means
56
that invariant violations are reported anyway. (See
57
https://github.com/AmpersandTarski/Ampersand/issues/728)
58
--language OUTPUTLANGUAGE
59
Pick 'NL' for Dutch or 'EN' for English, as the
60
language to be used in your output. Without this
61
option, output is written in the language of your
62
context.
63
--[no-]legal-refs Enable/disable generation of a table of legal
64
references in Natural Language chapter of the output
65
document. (default: disabled)
66
--verbosity VERBOSITY Verbosity: silent, error, warn, info, debug
67
-v,--verbose Enable verbose mode: verbosity level "debug"
68
--silent Enable silent mode: verbosity level "silent"
69
--[no-]time-in-log Enable/disable inclusion of timings in logs, for the
70
purposes of using diff with logs (default: enabled)
71
--[no-]terminal Enable/disable overriding terminal detection in the
72
case of running in a false terminal
73
--terminal-width INT Specify the width of the terminal, used for
74
pretty-print messages
75
--output-dir DIR Specify the directory where your output will be
76
written to
77
--help Show this help text
Copied!