add documentation

This commit is contained in:
Luna 2019-06-06 23:45:54 -03:00
parent 627b49b418
commit 92a3076b9b
4 changed files with 44 additions and 2 deletions

37
doc/README.md Normal file
View file

@ -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.

2
examples/loadsave.scri Normal file
View file

@ -0,0 +1,2 @@
load :1;
quicksave;

View file

@ -0,0 +1,3 @@
load :1;
echo 3 0 1 0.2;
quicksave;

View file

@ -22,7 +22,7 @@ def main():
continue continue
interp.run(stmt) interp.run(stmt)
except InterpreterError as err:
print(f'Interpreter error. {err.args[0]!r}')
print('OK') print('OK')
except InterpreterError as err:
print(f'Interpreter error. {err.args[0]!r}')