Implement convert and while + file-based editing

This commit is contained in:
2026-05-28 09:37:45 -05:00
parent 1d20aa59d1
commit afd99d7dfd
8 changed files with 238 additions and 2 deletions

10
HELP.md
View File

@@ -90,6 +90,11 @@ str %>
### I/O & Editor Control
By default, `str` launches with an empty string as its initial subject (`''`).
The command also accepts a file as its only parameter (e.g. `str my-file.txt`).
If a file is provided, `str` will read from the file **and overwrite the file
with the current subject when `exit` is called.**
#### `exit`
Stop `str` and exit. This can also be done with `^C`.
@@ -401,6 +406,11 @@ Replace the current subject with "Lorem ipsum..." placeholder text.
Can generate individual words, lines, or paragraphs.
Example: `lipsum 4 word` -> `lorem ipsum dolor sit`
#### `convert <from> <to>`
Assuming the current subject is a valid single data document, convert it `from` a lang `to` another lang.
Supports: `php`|`json`
Example: `{"a": 1}` -> `convert json php` -> `['a' => 1]`
#### User-specific setup files
The file `~/.str.rc` is automatically executed when `str` starts up.
You can use this to define a user-specific environment.