Skip to content

Ali127Dev/xcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 File/Directory Reader CLI

A simple, clean, and flexible command-line file reader written in Rust. It allows you to provide a file or directory path and prints file contents with line numbers — beautifully formatted. 🚀


✨ Features

  • 📁 Reads a single file and prints it with aligned line numbers.
  • 📂 Reads multiple files inside a directory (you choose how many).
  • 🔢 Smart input handling for selecting number of files.
  • ❌ Option to cancel at any moment.
  • ⚠️ Clear error messages for invalid paths or unsupported types.

🧠 How It Works

Just run the CLI with a path (file or directory).

  • If it's a file, it prints the content line by line.
  • If it's a directory, you'll be asked how many files you want to read.
  • Uses standard input/output for interactive prompts.

No deep project structure explanation here — so the README won’t become outdated after changes. 😉


🚀 Usage

1. Run with a file path

cargo run -- path/to/file.txt

2. Run with a directory path

cargo run -- path/to/directory

Then choose:

  • 0 → read all files
  • N → read N files
  • -1 → cancel

🧪 Example Output

reading: notes.txt
001| First line
002| Second line
003| ...

🛠 Requirements

  • Rust (stable)
  • Cargo

🤝 Contributions

Pull requests are welcome! Feel free to improve formatting, add flags, or expand functionality.


📜 License

MIT — free to use, modify, and distribute.

About

a improved cat-like tool ;)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages