Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

naan (CLI)

A small Rust CLI that behaves like a simplified grep.

Features

  • Search a file for a literal string** or a regex
  • Print matching lines with line numbers
  • --ignore-case, --count, --invert-match

Run

cd cli
cargo run -- "pattern" path/to/file.txt

Usage

naan [OPTIONS] <PATTERN> <PATH>

Arguments:
  <PATTERN>  Literal pattern (default) or regex (with --regex)
  <PATH>     Path of the file to search

Options:
  -i, --ignore-case     Case-insensitive search
  -r, --regex           Treat PATTERN as a regular expression
  -n, --line-number     Print line numbers (default: on)
  -c, --count           Print only the number of matching lines
  -v, --invert-match    Select non-matching lines
  -h, --help            Print help
  -V, --version         Print version

Examples

# Find lines containing "error"
naan error ./logs.txt

# Case-insensitive
naan -i error ./logs.txt

# Regex search
naan -r "^WARN|^ERROR" ./logs.txt

# Count matches
naan -c -i error ./logs.txt

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages