filecat

Crates.iofilecat
lib.rsfilecat
version0.3.1
sourcesrc
created_at2024-07-13 01:21:27.553668
updated_at2024-07-13 02:22:34.952167
descriptionPrint file contents with colored headers
homepagehttps://github.com/manorajesh/filecat
repositoryhttps://github.com/manorajesh/filecat
max_upload_size
id1301962
size757,368
mano (manorajesh)

documentation

README

filecat

Crates.io Version Crates.io License Crates.io Total Downloads

filecat is a command-line tool for printing file contents with titles.

Print file contents with colored headers

Usage: filecat.exe [OPTIONS] [PATHS]...

Arguments:
  [PATHS]...  File or directory paths

Options:
  -r, --recursive        Recursively read directories
  -e, --exclude <PATH>   Exclude specific files or directories
      --header <HEADER>  Custom header format [default: "==> {file}"]
  -v, --verbose          Do not show non-printable characters
      --hex              Print non-text file contents in hexadecimal format
      --color            Enable colored output of headers
      --no-log-color     Disable colored output of log messages
  -o, --output <FILE>    Write output to a file
      --counter          Enable file counter
      --skip-non-text    Skip non-text files but still print headers
  -h, --help             Print help
  -V, --version          Print version

Features

  • Print contents of files with customizable headers.
  • Recursively read directories.
  • Exclude specific files or directories from processing.
  • Display non-printable characters by default, with an option to turn this off.
  • Print file contents in hexadecimal format.

Usage

To print the contents of a file with a header, simply run filecat with the file path as an argument:

filecat file.txt

To print the contents of multiple files, provide multiple file paths:

filecat file1.txt file2.txt file3.txt

To print the contents of a directory, use the -r flag:

filecat -r directory

To exclude specific files or directories from processing, use the -e flag:

filecat -e file.txt directory

Installation

crates.io

You can install filecat from crates.io using cargo:

cargo install filecat

Building from Source

First, ensure you have Rust installed. Then, clone the repository and build the project:

git clone https://github.com/yourusername/filecat.git
cd filecat
cargo build --release

The binary will be located at target/release/filecat.

Commit count: 0

cargo fmt