Tidy the usaco CLI: prefixes everywhere, LOCAL debug builds, git-based dates
- done/skip/undo accept unique prefixes like every other command - builds define LOCAL (-I repo root): the template includes debugging.h and enables DBG/printV only locally, so main.cpp is submittable as-is - run/build/test --debug (or USACO_DEBUG=1): ASan/UBSan + _GLIBCXX_DEBUG - list/stats date problems by git history, not mtimes reset by checkouts - template/tpl is now an alias of reset (which gains -y); fixes template dropping the STDIO line - run shows <io>.out via detect_io instead of the first *.out - debugging.h: size_t loop indices (no -Wsign-compare noise) - zsh completion for i/cat/copy; README covers test, io, reset, --debug - ignore a.out Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+8
-6
@@ -1,14 +1,16 @@
|
||||
# usaco reset/rm/delete <name>
|
||||
# usaco reset/rm/delete/template/tpl <name> [-y]
|
||||
[[ $# -ge 1 ]] || usage
|
||||
dir="$(find_problem "$1")"
|
||||
name="$(basename "$dir")"
|
||||
io="$(detect_io "$dir" || true)"
|
||||
io="${io:-$name}"
|
||||
echo "This resets ${dir#$ROOT/} to a fresh template:"
|
||||
echo " main.cpp -> re-created from template (old one saved as main.cpp.bak)"
|
||||
echo " removes compiled binary and $io.out (tests/ and $io.in are kept)"
|
||||
read -r -p "Reset '$name'? [y/N] " ans
|
||||
[[ "$ans" == y || "$ans" == Y ]] || { echo "Aborted."; exit 1; }
|
||||
if [[ "${2:-}" != -y ]]; then
|
||||
echo "This resets ${dir#$ROOT/} to a fresh template:"
|
||||
echo " main.cpp -> re-created from template (old one saved as main.cpp.bak)"
|
||||
echo " removes compiled binary and $io.out (tests/ and $io.in are kept)"
|
||||
read -r -p "Reset '$name'? [y/N] " ans
|
||||
[[ "$ans" == y || "$ans" == Y ]] || { echo "Aborted."; exit 1; }
|
||||
fi
|
||||
[[ -f "$dir/main.cpp" ]] && cp "$dir/main.cpp" "$dir/main.cpp.bak"
|
||||
fresh_main "$dir" "$io"
|
||||
rm -f "$dir/main" "$dir/a.out" "$dir/$io.out"
|
||||
|
||||
Reference in New Issue
Block a user