GitXplorerGitXplorer
P

anew

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
96867b64817da7f9984fb8bbbfca1dc62a62b1c2

housekeeping: Removed uncompatible cpu-native compilation props

PPeriecle committed 4 months ago
Verified
1b58ff272a9291851b3c4f5dc36f234319993cef

housekeeping: Added LTO and basic benchmark. Closes GH-2

PPeriecle committed 4 months ago
Verified
656a49e1585574ca0d5570d0163a5dde3c05f76c

fix: Revert release job

PPeriecle committed 4 months ago
Verified
0891c1a757b11e0bdf410fad26ab5820f73f5c8f

Update Release Job

PPeriecle committed 4 months ago
Verified
91cbf3a93853caf42d025af74f98d397a93caf8f

housekeeping: adding Windows to builds

PPeriecle committed 4 months ago
Verified
726836325b11d120598b25cfe01f4f313238e3df

housekeeping: adding Windows to builds

PPeriecle committed 4 months ago

README

The README file for this repository.

anew

CI

Basically it's a Rust rewrite of Tomnomnom anew originally written in Go.

70% of the Readme is a tomnomnom work. Append lines from stdin to a file, but only if they don't already appear in the file. Outputs new lines to stdout too, making it a bit like a tee -a that removes duplicates.

Usage Example

Here, a file called things.txt contains a list of numbers. newthings.txt contains a second list of numbers, some of which appear in things.txt and some of which do not. anew is used to append the latter to things.txt.

▶ cat things.txt
Zero
One
Two

▶ cat newthings.txt
One
Two
Three
Four

▶ cat newthings.txt | anew things.txt
Three
Four

▶ cat things.txt
Zero
One
Two
Three
Four

Note that the new lines added to things.txt are also sent to stdout, this allows for them to be redirected to another file:

▶ cat newthings.txt | anew things.txt > added-lines.txt
▶ cat added-lines.txt
Three
Four

Flags

  • To view the output in stdout, but not append to the file, use the dry-run option -d or --dry-run.
  • To append to the file, but not print anything to stdout, use quiet mode -q or --quiet.
  • To trim the lines before saving to file, use trim -t or --trim.

Installation

Download the binary for your platform from the Releases page.

From Source

git clone https://github.com/Periecle/anew.git
cd anew
cargo build --release