Brings in the stashed Rust work, merged onto the current CLI. A problem's language is whichever source it has (main.cpp or main.rs); 'usaco lang' sets the default for new problems (.lang, or $USACO_LANG), and 'new --rust/--cpp' picks per problem. template.rs is a paste-ready Rust template whose stdio() uses <io>.in/.out when present and stdin/stdout otherwise. run/test now feed <io>.in on stdin and capture stdout when the program doesn't write <io>.out itself, so Codeforces-style solutions work too. 'reset <name> rust|cpp' switches a problem's language (template is still an alias), and --debug builds Rust with overflow checks and debug assertions. 'usaco lint' runs clippy through a generated, gitignored Cargo.toml that also gives rust-analyzer a project; done/skip/undo keep it in step. LeetCode imports stay C++. Also: done stages solved/ and solving/ separately, so a problem that was never committed from solving/ still gets its "Solve" commit, and the site lists main.rs ahead of other files like it does main.cpp. Co-Authored-By: Claude Opus 5.5 <[email protected]>
14 lines
350 B
Bash
14 lines
350 B
Bash
# usaco run <name>
|
|
[[ $# -ge 1 ]] || usage
|
|
dir="$(find_problem "$1")"
|
|
build_problem "$dir"
|
|
io="$(detect_io "$dir" || true)"
|
|
io="${io:-$(basename "$dir")}"
|
|
rc=0; run_solution "$dir" "$io" || rc=$?
|
|
if [[ -e "$dir/$io.out" ]]; then
|
|
echo "── $io.out ──"
|
|
cat "$dir/$io.out"
|
|
fi
|
|
[[ $rc -eq 0 ]] || echo "${RED}exited $rc${RST}" >&2
|
|
exit $rc
|