Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefafafan/swapall
A cli tool to help swap a pair of strings from stdin.
https://github.com/stefafafan/swapall
cli replace rust
Last synced: 16 days ago
JSON representation
A cli tool to help swap a pair of strings from stdin.
- Host: GitHub
- URL: https://github.com/stefafafan/swapall
- Owner: stefafafan
- License: mit
- Created: 2024-11-12T05:18:08.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-10T01:32:05.000Z (24 days ago)
- Last Synced: 2024-12-10T02:26:35.873Z (24 days ago)
- Topics: cli, replace, rust
- Language: Rust
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# swapall
swapall is a CLI tool used to help swap a pair of strings from stdin, and outputting to stdout.
It assumes the pair of strings are formatted as a csv file.
## Installation
Assuming you have cargo setup:
```sh
cargo install --git https://github.com/stefafafan/swapall
```## Usage
Try `--help`
```sh
$ swapall --helpUsage: swapall
Arguments:
The filepath to the CSV file.Options:
-h, --help Print help
-V, --version Print version
```### Example
Let's say you have a CSV containing the following contents. (swapall assumes the CSV does *not* have a header row!)
```sh
$ cat replacements.csv
hello,bye
123,456
こんにちは,さようなら
```Try piping a string and see how each occurrence of the first value is replaced as the second.
```sh
$ echo "hello (こんにちは) my favorite number is 123456123." | swapall ./replacements.csv
bye (さようなら) my favorite number is 456456456.
```