reverses all collected input from arguments or stdin lines, then outputs it (configurably) line by line to stdout
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Avril ff898fc9b3
Added feature `mapped-file`: Attempt to `mmap()` input where possible to avoid reads. (NOTE: This should be replaced with a cfg-target-unix check, for now it is a default feature that can be disabled.)
2 months ago
src Added feature `mapped-file`: Attempt to `mmap()` input where possible to avoid reads. (NOTE: This should be replaced with a cfg-target-unix check, for now it is a default feature that can be disabled.) 2 months ago
.gitignore Added testing features for buffering output, and ignoring output errors. 2 years ago
Cargo.lock Re-worked cargo features & dependencies: Removed previous config features. Added `threads` parallelisation (+ auto `threads-async` internal io_uring support) feature and `unstable` feature for unstable-api using deps. 2 months ago
Cargo.toml Added feature `mapped-file`: Attempt to `mmap()` input where possible to avoid reads. (NOTE: This should be replaced with a cfg-target-unix check, for now it is a default feature that can be disabled.) 2 months ago
Makefile Changed print output to line-by-line (can be re-set to debug print output with feature flag.) 2 years ago
README.md Added README.md 2 years ago

README.md

reverse

Collects input, reverses it, then outputs it.

Usage

From arguments:

$ reverse 1 2 3 4
4
3
2
1

From standard input:

$ find . | reverse

Standard input is read line by line, unlike arguments. The two cannot be combined.

Build

Requires rust and cargo installed:

$ cargo build --release

The outputted binary will be ./target/release/reverse.

Customise behaviour

There are several compile-time flags. See ./Cargo.toml for the description of each one.

To build with custom features:

$ cargo build --release --no-default-features --features <your feature>,...

License

Public domain.

This is a toy project I used to play around with what I could do with slice patterns in Rust.