From 92a3076b9bc23b09a9f1b20651524a0070d005e3 Mon Sep 17 00:00:00 2001 From: Luna Date: Thu, 6 Jun 2019 23:45:54 -0300 Subject: [PATCH] add documentation --- doc/README.md | 37 +++++++++++++++++++++++++++++++++++++ examples/loadsave.scri | 2 ++ examples/middle_echo.scri | 3 +++ scritcher/main.py | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 doc/README.md create mode 100644 examples/loadsave.scri create mode 100644 examples/middle_echo.scri 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')