A thi-script is basically a help-file. thi-scripts are organised hierarchically in directory/subdirectories. $THIPATH is the base directory. Both, directory and files are thi-scripts and can be accessed in the same way.
Invoking a thi-script file, displays the file.
Invoking a thi-directory will display the directory's content.
By simply typing the corresponding number and [enter] directly on the console, the chosen thi-script is displayed: Choosing a directory will move to the chosen directory and show the entries.
To display a thi-script, simply type the corresponding number and [enter].
The above example shows thi-script "dummy.thi". The numbers displayed refer to thi-commands. By typing the corresponding number and [enter] the commands are executed. thi-commands can spawn over one line or many lines and can contain one or many shell commands.
Thi-commands are one or more shell commands grouped together and offered for execution. They are numbered and marked red.
Every thi-command in the thi-script can directly be executed by typing the corresponding number in the console and [enter].
There are three types of thi-commands:
Regular thi-commands are one or many shell commands grouped together an offered for execution. Typing the corresponding number and [enter] on the console will execute the command within the thi-command.
File command (or @cmf-statements) are links to scripts: The command just contains the scriptname to execute. 'x' toggles between showing the script's content or showing the script's name.
Alias commands are like file comands. The real command lies in a script, like in file commands, but toggling is not possible. The text shown is just text that will not be executed. Alias commands are mainly used when special characters mess up the display (or when you want to hide a long and ugly shell script ;-) ...).
You don't have to use command number 1 before using command number 2. Each command listed is independent and can be executed by itself.
The command is executed 'as is'. There is no checking if a previous command has been executed (that is essential), nor is there checking if a command was executed successfully.
Thi-commands can contain a single command or stretch over multiple lines.
Thi-command number 3 contains a variable. Above the variable value is shown. To toggle between showing the variable name and the varible value, use:
q [enter]
The command looks like this.
To turn highlighting of a-variables on/off, use:
h [enter]
To change an variable, use:
d [enter].
The variable dialog lists all a-variables used in the current thi-script. After choosing an variable, a list with predefined options for this variable is shown, if there are any. Variable '$MYVAR' is set to the default.
To pick an entry from the list, just type the corresponding number and [enter]. To enter a new value, type the new value and press [enter]. To edit the list, just press [enter].
After setting a variable, the value will be stored for the future.
The statement
{{@?:<prompt text>}}
prompts for user input just before the commands in a thi-command are executed. The ask-statement prompts for user input with the 'prompt text' and then replaces itself (the entire {{@?:..}}) with the user input.
In the above example, the ask-statement prompts with the parameter "what's the weather, dude?" and then replaces itself with the answer.
Textfiles can be included into thi-scripts as textfiles.
{{@file:<path/to/file>}}
To toggle between showing the file's name and the file's content, use:
z [enter]
This also toggles between @command-statements