diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000..7af813a --- /dev/null +++ b/doc/README.md @@ -0,0 +1,37 @@ +scritcher command reference +--- + +scritcher scripts are shell-like commands separated by a semicolon. + +## parameters of the arg type + +some commands allow a `:N` syntax where N is an integer to use a given +argument when `scritcher` is called. so, for example, calling a script: +``` +load :1; +showpath; +``` + +and then doing `scritcher path/to/script.scri arg` will print `arg` on the +screen and then exit. + + +## `load path_or_arg` + +Load a file into memory. The file will be converted to BMP. + +## `echo split index delay` + +Run an echo filter on the given loaded file. + +## `quicksave` + +Save the file on the same directory of the file specified by `load`, but +with a suffix on the filename (before extension). + +Doing consecutive `quicksave`s will not overwrite any files, the suffixes will +just be different. + +## `showpath` + +Print the current loaded path on the screen. diff --git a/examples/loadsave.scri b/examples/loadsave.scri new file mode 100644 index 0000000..6366531 --- /dev/null +++ b/examples/loadsave.scri @@ -0,0 +1,2 @@ +load :1; +quicksave; diff --git a/examples/middle_echo.scri b/examples/middle_echo.scri new file mode 100644 index 0000000..0e8b3dd --- /dev/null +++ b/examples/middle_echo.scri @@ -0,0 +1,3 @@ +load :1; +echo 3 0 1 0.2; +quicksave; diff --git a/scritcher/main.py b/scritcher/main.py index 96d1b6f..b3c1370 100644 --- a/scritcher/main.py +++ b/scritcher/main.py @@ -22,7 +22,7 @@ def main(): continue interp.run(stmt) + + print('OK') except InterpreterError as err: print(f'Interpreter error. {err.args[0]!r}') - - print('OK')