https://github.com/sneekyfoxx/zap
Zap is a Linux command line utility written in Nim
https://github.com/sneekyfoxx/zap
command-line-utility nim
Last synced: about 1 month ago
JSON representation
Zap is a Linux command line utility written in Nim
- Host: GitHub
- URL: https://github.com/sneekyfoxx/zap
- Owner: sneekyfoxx
- License: agpl-3.0
- Created: 2024-01-21T14:35:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T07:28:07.000Z (over 2 years ago)
- Last Synced: 2025-10-09T08:13:32.271Z (9 months ago)
- Topics: command-line-utility, nim
- Language: Nim
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
███████╗_█████╗_██████╗_
╚══███╔╝██╔══██╗██╔══██╗
__███╔╝_███████║██████╔╝
_███╔╝__██╔══██║██╔═══╝_
███████╗██║__██║██║_____
╚══════╝╚═╝__╚═╝╚═╝_____
⚡ zap characters from text with ease
## About
**Zap** is a command line utility which combines the basic functionalities of two well known command line utilities, **cut** and **tr**. Zap doesn't have all the functionalities of *cut* or *tr* because it isn't meant to replace them. **Zap** was created to make slicing strings in the terminal a little bit easier. **Zap** removes all escape characters and truncates all spaces by default reducing the number of zaps, cuts, and translations in the process.
## Similarities To *cut*
- slice strings based on a given delimiter
- select a one or more fields (range in zap)
## Similarities To *tr*
- character truncation (default in zap)
- ANSII escape character deletion (not including hex and octal)
- character replacement (injection in zap)
## Why use *Zap*?
Some of the benefits of using **Zap** is that it can help reduce the number of times *cut* and *tr* may need to be executed. Example: `"some text" | zap -d:":" -l | grep -E 'something'`. The previous example removes all ASCII escape sequences as well as the ':' character, gets the last field, and sends the output to grep. In many cases you may find yourself using *zap* inplace of *cut*.
## Usage Information
- **zap** *-d:TEXT* [*-i:TEXT* | *-g:POS* | *-r:START,STOP*] [*-f* | *-l*] TEXT
- TEXT | **zap** *-d:TEXT* [*-i:TEXT* | *-g:POS* | *-r:START,STOP*] [*-f* | *-l*]
## Usage Examples
``` bash
$ example="This is some\nexample text\tfor testing the zap utility\0"
$ zap -d:'example' -i:'actual'
This is some actual text for testing the zap utility
$
```