9 stable releases

1.6.6 Aug 30, 2023
1.6.5 Jul 27, 2023
0.2.0 Sep 5, 2020
0.1.0 Sep 3, 2020

#480 in Command line utilities

35 downloads per month

MIT license

68KB
1.5K SLoC

Rust 1.5K SLoC // 0.1% comments C++ 108 SLoC // 0.1% comments Python 85 SLoC // 0.0% comments

kattis.rs

A simple automated problem tester for problems on the Kattis Problem Archive.

crates.io crates.io

Usage

Tests and submits Kattis competitive programming problems.

Usage: kattis [OPTIONS] [PROBLEM]...

Arguments:
  [PROBLEM]...
          Paths of files to test or no arguments.
          Filenames should be of the format {problem}.{ext} where {problem} can be found from the url of the kattis problem at open.kattis.com/problems/{problem}.
          If left empty, the problem to run will be inferred by looking for the latest edited valid source file in the working directory.

Options:
  -s, --submit
          If flag is set, all successful problems will be submitted.

  -f, --force
          Force submission even if submitted problems don't pass local tests.

  -r, --recurse <DEPTH>
          Number of directory levels to recurse into when searching for problem solutions.

          [default: 1]

      --submission-viewer <submission-viewer>
          Viewer to use for submission.

          [default: cli]

          Possible values:
          - cli:     Display updated results in the CLI, blocking until submission has finished
          - browser: Open a new browser window showing the submission and terminate program
          - none:    Just terminate, ignoring submission result

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Submit

The simplest use case for the CLI is when you want to test and submit the latest edited file in a directory:

$ kattis -s

This command will find the latest edited valid file in the current directory and test it using input and output from www.open.kattis.com, then submit it if it passes.

Installation

Using Cargo

First install the Rust toolchain using rustup. This will also install Cargo.

$ cargo install kattis-rs

The installation path will show up after installation. Add it to your PATH by adding the cargo binary directory to PATH (usually $HOME/.cargo/bin).

kattis-rs is only tested on macOS and Linux, but should work on Windows.

Dependencies

~17–34MB
~543K SLoC