Tightener Command Line Switches - zwettemaan/TightenerDocs GitHub Wiki

The Tightener executable, which drives commands like rt, rrt, rre, evalTQL... takes a number of command line parameters.

Some of these command line parameters have equivalent entries in the config.ini.

When both config.ini and command line settings are used, the command line settings will take precedence over the values in the config.ini.

-c: designated config.ini

-c instructs Tightener to use a different config.ini file, instead of the shared, system-wide config.ini

Examples:

Tightener -c ~/Desktop/myOwnConfig.ini
Tightener -c %USERPROFILE%\Desktop\myOwnConfig.ini

-e: console echo type

(Internal).

-e determines how the internal console reading functions behave. This switch is only useful when debugging Tightener from the Xcode IDE: when doing that, the Tightener exhibits a 'double echo' and each typed character is echoed twice.

Setting -e 0 turns off Tightener's own echo, leaving only the echo from Xcode, and that makes it possible to run Tightener in console mode from an Xcode IDE debug session.

Equivalent config.ini entry:

[config]
consoleEcho = 1
0 = NONE
1 = TERMIOS
2 = HARDCODED
3 = TERMIOS_AND_HARDCODED

Internally in C++

    if (fEchoType == EchoType::TERMIOS || fEchoType == EchoType::TERMIOS_AND_HARDCODED)
    {
        termios.c_lflag |= ECHO;
    }
    else
    {
        termios.c_lflag &= ~ECHO;
    }
...
                if (fEchoType == EchoType::HARDCODED || fEchoType == EchoType::TERMIOS_AND_HARDCODED)
                {
#if IS_MAC || IS_LINUX
                    putchar(c);
#endif // IS_MAC || IS_LINUX
#if IS_WINDOWS
                    if (c == '\r')
                    {
                        _putch('\n');
                    }
                    _putch(c);
#endif // IS_WINDOWS
                }
            }

-d: keep session data up-to-date

Adding -d to the command line will tell Tightener to create and regularly update a session data file.

The SessionData files are .json files in the SessionData directory.

To see the SessionData files:

cd_settings
cd SessionData

If a coordinator is running with -d, you can delete the SessionData JSON file for that coordinator, and it will auto-update and reappear.

-f: script file to execute

Execute the script file provided. -f can be used in conjuction with -r and -o to execute scripts on a remote coordinator.

Example:

Tightener -N myScriptRunner -f someScript.tql

-i: interactive

The -i switch enables the Tightener console. It will allow direct keyboard input and will honor the backspace key.

The console coordinator is configured to use -i.

-s and -i cannot be used at the same time.

Equivalent config.ini entry:

[config]
isInteractive = 1

Example:

Tightener -N myconsole -t n -i

-n: coordinator (Reverse Domain Name)

By default, when launching from the command line, Tightener will try to be main (aka net.tightener.coordinator.main)

-n tells Tightener what coordinator it should be.

-n expects a full Reverse Domain Name

Also see -N

Examples:

Tightener -n net.tightener.coordinator.console
Tightener -n net.tightener.coordinator.my_own_coordinator

When picking your own coordinator name, you can add the necessary sections to the config.ini to determine how this coordinator should work .

For example, I use this to create multiple reflector coordinators, and test scripts that bounce messages between them.

-N: coordinator (short name)

-N is almost the same as -n. Tightener will prefix the name given with -N with net.tightener.coordinator..

These two command lines are equivalent:

Tightener -N console
Tightener -n net.tightener.coordinator.console

-o: remote timeout in milliseconds

When sending a script to a remote coordinator by way of -r and -f, wait for this amount of time for the script to complete.

-r works together with -f and -o.

Equivalent config.ini entry (which uses microseconds, not milliseconds):

[config]
remoteTimeoutMicroseconds = 10000000

Example:

Tightener -N myRunner -r indesign -f someScript.tql -o 10000

-r: remote coordinator

Send the script provided with the -f paramater to this coordinator.

The coordinator can be a fully qualified RDN (Reverse Domain Name) or a coordinator shorthand defined in the config.ini in the [coordinatorMap] section.

-r works together with -f and -o.

Example:

Tightener -N myRunner -r indesign -f someScript.tql

-s: make this coordinator long-lived

Most Tightener coordinators are short-lived, and try to quit ASAP (e.g. after running a script).

In some cases, we want to keep coordinators alive for a long time, as background processes.

This is achieved by using the -s switch.

Equivalent config.ini entry:

[config]
isServer = 1

main and reflector are two coordinators that are configured to be long-lived.

Example:

Tightener -N myOwnReflector -t n -s

-t: run internal tests on startup

(Internal).

-t y or -t n. This runs a battery of internal tests. This will fail in the release version of Tightener because the test-scripts are not in the released material.

[config]
runTests = 1

-w: quit delay in milliseconds

-w tells Tightener to wait for some time when it is instructed to quit.

Tightener might want to quit because it is a short-lived coordinator (non-server), or it is a long-lived coordinator (server) executing a script that calls the quit() function.

Delaying the quit allows Tightener to continue receiving data and executing callbacks. This is useful when this Tightener coordinator is interacting with another coordinator, and the response might take a while to arrive.

Equivalent config.ini entry:

[config]
eventLoopMicroseconds = 50000

Example:

Tightener -N scriptrunner123 -w 10000