diff --git a/site/web/src/App.vue b/site/web/src/App.vue index e0f8203..1881594 100644 --- a/site/web/src/App.vue +++ b/site/web/src/App.vue @@ -13,6 +13,7 @@ import { RouterLink, RouterView } from "vue-router"; Problems Stats CLI + Source adam-french.co.uk diff --git a/site/web/src/views/CliPage.vue b/site/web/src/views/CliPage.vue index edf138e..65936a7 100644 --- a/site/web/src/views/CliPage.vue +++ b/site/web/src/views/CliPage.vue @@ -5,6 +5,11 @@ * itself can't be imported. Keep the two in step when the CLI changes. */ +// The repo on the site's Gitea, behind the same nginx, so a root-relative +// link works. +const repo = "/gitea/adamf/usaco"; +const src = (path) => `${repo}/src/branch/main/${path}`; + // Every command that takes a problem name accepts a unique prefix, so the // examples use the full name only where it reads better. const sections = [ @@ -79,8 +84,9 @@ usaco [watermelon:solved]> q`;

The usaco CLI

- Every problem here is written in a workspace managed by ./usaco, a small bash script at - the repo root. Each problem lives in solving/, solved/ or + Every problem here is written in a workspace managed by ./usaco, a small bash script at + the root of the repo on Gitea (the commands themselves are in + lib/cmd/). Each problem lives in solving/, solved/ or skipped/ as a directory with main.cpp and its .in/.out files. Wherever a command takes a problem name, a unique prefix works too: usaco e diam finds diamond-collector. @@ -90,11 +96,14 @@ usaco [watermelon:solved]> q`;

Setup

-

Run it as ./usaco from the repo root, or add this to ~/.zshrc:

-
source ~/Coding/USACO/usaco.zsh
+

Clone the repo and run ./usaco from its root:

+
git clone https://www.adam-french.co.uk{{ repo }}.git
+

Or add this to ~/.zshrc:

+
source ~/Coding/USACO/usaco.zsh

That makes usaco a global command, adds tab completion for commands and problem names, and - adds ucd <name> to cd into a problem's directory. + adds ucd <name> to cd into a problem's directory. The full reference is the + README.

@@ -134,8 +143,8 @@ usaco [watermelon:solved]> q`;

Debug output

- usaco builds define LOCAL, which the template uses to include - debugging.h (pretty-printers for vectors, maps and pairs) and enable its + usaco builds define LOCAL, which the template uses to include + debugging.h (pretty-printers for vectors, maps and pairs) and enable its DBG(x) macros. The judge doesn't define it, so main.cpp is submittable as-is.