Voila forthebadge forthebadge

Contributor Covenant GitHub license GitHub release 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.

Syntax

voila DIRECTORY "<@VARIABLE | STRING | #REGEXP#> OPERATOR <@VARIABLE | STRING | #REGEXP#> [|| | && 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. Regular expressions are delimited between #. 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

Error types

Voila provides 2 main error types:

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

Message from the author

Voila has been coded & tested by only one person, so don't expect it to be perfect. I'm looking for more people interested in maintaining Voila and helping out, if you're interested, DM me on discord (NOT-Guillem#8042). Voila's discord server is this