Document cat, copy, and interactive REPL in README
Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
@@ -53,6 +53,32 @@ Opens from inside the problem dir, so the `.in`/`.out` files are right there.
|
|||||||
./usaco open diamond-collector # open the saved problem URL in a browser
|
./usaco open diamond-collector # open the saved problem URL in a browser
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Snippets
|
||||||
|
```
|
||||||
|
./usaco cat diamond-collector # print main.cpp to stdout (pipeable)
|
||||||
|
./usaco cat diam | wl-copy # e.g. pipe it wherever you want
|
||||||
|
./usaco copy diamond-collector # copy main.cpp to the clipboard (alias: cp)
|
||||||
|
```
|
||||||
|
`copy` auto-detects the clipboard tool: `wl-copy` on Wayland, then `xclip`/`xsel` on X11, and falls back to an OSC52 terminal escape that works even over SSH.
|
||||||
|
|
||||||
|
### Interactive mode
|
||||||
|
```
|
||||||
|
./usaco i # (aliases: interactive, repl)
|
||||||
|
```
|
||||||
|
A REPL that remembers the problem you're working on, so commands drop the name:
|
||||||
|
```
|
||||||
|
usaco [none]> s diamond-collector # select (a bare name/prefix works too)
|
||||||
|
usaco [diamond-collector:solving]> r # run, test, edit... no name needed
|
||||||
|
usaco [diamond-collector:solving]> t c # create a test case
|
||||||
|
usaco [diamond-collector:solving]> e watermelon # giving a name switches to it
|
||||||
|
usaco [watermelon:solving]> done
|
||||||
|
usaco [watermelon:solved]> none # clear the selection
|
||||||
|
usaco [none]> q
|
||||||
|
```
|
||||||
|
REPL-only commands: `s [name]` (select/show), `none`, `push [name]`/`pop`/`stack` (stash the current problem, work on another, come back), `help [cmd]`, `!cmd` (shell command run in the problem dir), `q`.
|
||||||
|
|
||||||
|
The selection persists across sessions in `.current` (cleared automatically if the problem no longer exists); history is in `.usaco_history`. Tab completion works for both commands and problem names.
|
||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
```
|
```
|
||||||
./usaco template diamond-collector # reset main.cpp from template (old one saved as main.cpp.bak)
|
./usaco template diamond-collector # reset main.cpp from template (old one saved as main.cpp.bak)
|
||||||
|
|||||||
Reference in New Issue
Block a user