Voila forthebadge forthebadge

Contributor Covenant GitHub license Lines of code GitHub release (latest SemVer) GitHub commits since latest release (by date) GitHub Release Date GitHub last commit GitHub contributors OSS Lifecycle Crates.io Crates.io (latest) Linux build macOS build Windows build

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your Voila code and do something like this voila DIRECTORY "$(cat operations.vla)". Voila is mainly tested in Linux, so should work better in nix (Linux,BSD, macOS, etc) than in Windows-based operating systems, but shouldn't be any problems on them.

Syntax

$ voila DIRECTORY '<@VARIABLE | STRING> OPERATOR <@VARIABLE | STRING> [|| | && ANOTHER_CONDITIONAL ...] {OPERATION1-CYCLE-1(ARG1 ARG1, ARG2) OPERATION2-CYCLE-1(ARG1 ARG2) ...; OPERATION1-CYCLE-2(ARG1, ARG2 ARG2, ARG3)...}'

Voila's syntax is composed of a traditional conditional/multi-conditional statement, followed by the operations, delimited within curly brackets. These are separated into cycles. A cycle is an iteration between all directory files, the operations in every cycle are executed in parallel, and cycles are executed consecutively. cycles are separated with ;, and operations/functions arguments are separated with ,. Variables' prefix is @, and its value changes to the file that is evaluating. For a more intuitive explanation, go to the "Examples" section.

These are the available conditional operators:

These are the available variables:

These are the available operations/functions:

⚠️ WARNING: If you use functions that access and/or modify the same file/directory in the same cycle it could cause undefined behavior because the file would be accessed and overwritten at the same time. For avoiding that, consider splitting those functions into different cycles. A workaround is being discussed in #5

forthebadge

Examples

CLI flags

Installation

You can install voila by cloning the repository and compiling or by cargo install voila. I have planned to provide prebuilt binaries soon.

Submitting