Command-line interface

Use this to run Perun2 directly or from other applications.


Command

Environment variable path should contain location where Perun2 is installed. This value is usually set automatically during the installation. This way you can reach the main Perun2 executable file, which is perun2.exe. If you cannot run Perun2 from the command-line, then probably this value is missing and you have to set it manually.

In order to test the interface, run perun2 --help.

env variable example path
path C:/Program Files/Perun2

Command requires an argument, which is the file with Perun2 script. By default, working location is the directory where this script file is located. Command can contain following options:

option meaning
-c [value] pass Perun2 code as an argument instead
-n run in noomit mode
-d [value] change working location to an arbitrary value
-h set working location to the place where this command was called from
-s silent execution - no command logs
-g GUI mode - option used only internally
-m static analysis - check code correctness without running it
--help display help
--version display interpreter version
--website enter front page of this website
--docs enter documentation from this website

Mode noomit turns off the internal Perun2 protection mechanism, that forces skipping own script files (*.peru) while iterating the file system. Silent execution disables command log messages and can increase performance significantly if millions of files are processed.

Make sure to put any arguments that contain spaces inside quotation marks. Excessive arguments are passed forward to the Perun2 process.

Examples

Note: paths to locations and script files can be both relative and absolute. Extension is optional, as the interpreter assumes it to be peru.

command meaning
perun2 _mp3 run script file '_mp3.peru' inside its own directory
perun2 -d F:\\music _mp3 run script file '_mp3.peru' in certain location
perun2 -c "select files where creation = today" run certain Perun2 code in current location
perun2 -n _mp3 1 2 run script file '_mp3.peru' in noomit mode and pass two arguments to the process (numbers 1 and 2)
perun2 -c -d docs "delete directories where empty" run certain Perun2 code in a relative directory docs