Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tranzystorekk/aoc-utils
A minimal set of utils for writing Advent of Code solutions.
https://github.com/tranzystorekk/aoc-utils
advent-of-code cli rust-library
Last synced: 21 days ago
JSON representation
A minimal set of utils for writing Advent of Code solutions.
- Host: GitHub
- URL: https://github.com/tranzystorekk/aoc-utils
- Owner: tranzystorekk
- License: mit
- Created: 2020-05-25T16:31:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-17T12:54:13.000Z (about 1 year ago)
- Last Synced: 2024-10-15T09:11:24.777Z (23 days ago)
- Topics: advent-of-code, cli, rust-library
- Language: Rust
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code Rust utilities
[![Crates.io](https://img.shields.io/crates/v/aoc-utils)](https://crates.io/crates/aoc-utils)
[![Docs.rs](https://docs.rs/aoc-utils/badge.svg)](https://docs.rs/aoc-utils)
[![Crates.io](https://img.shields.io/crates/l/aoc-utils)](https://github.com/tranzystorek-io/aoc-utils/blob/master/LICENSE)## About
This crate provides a very minimal set of utils to get started
with writing [Advent of Code](https://adventofcode.com/) solutions.## `AocCommand`
### Description
This is a CLI command builder that provides an input source (either a file or STDIN).
The suggested workflow is to create a Rust project with one binary per AOC solution.Here is an example help printout generated from a program generated by `AocCommand`:
```console
Example descriptionUSAGE:
prog [FILE]FLAGS:
-h, --help Prints help information
-V, --version Prints version informationARGS:
Input file (defaults to STDIN if not provided)
```### Usage
Collect all lines from input:
```rust
use std::io::BufRead;
use aoc_utils::AocCommand;let input = AocCommand::new("Example solution").parse_args().unwrap();
let lines: Vec = input.lines().map(Result::unwrap).collect();for line in lines {
println!("{}", line);
}
```