- 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]>
12 lines
669 B
Bash
12 lines
669 B
Bash
# usaco done <name>
|
|
[[ $# -ge 1 ]] || usage
|
|
dir="$(find_problem "$1")"; name="$(basename "$dir")"
|
|
[[ "$dir" == "$ROOT/solving/$name" ]] || { echo "Error: $name is not in solving/ (it's in ${dir#$ROOT/})" >&2; exit 1; }
|
|
[[ -d "$ROOT/solved/$name" ]] && { echo "Error: solved/$name already exists" >&2; exit 1; }
|
|
mv "$ROOT/solving/$name" "$ROOT/solved/$name"
|
|
echo "Moved to solved/$name 🎉"
|
|
if git -C "$ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
git -C "$ROOT" add -A "solved/$name" "solving/$name" 2>/dev/null || true
|
|
git -C "$ROOT" commit -m "Solve $name" >/dev/null && echo "Committed: Solve $name ${DIM}(usaco sync to publish it)${RST}"
|
|
fi
|