Skip to content

Skosulor/rcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rcat: cat rewritten in rust Build status

Goal: rewrite cat from GNU's coreutils in rust.

Why? To learn rust and programming.

Installation

requirements: cargo

git clone https://github.com/Skosulor/rcat
cd rcat
cargo build --release

path to rcat: rcat/target/release/rcat

Usage

rcat [FLAGS] [FILE]

if no file is given, input is taken from stdin

Differences from cat

  • If show-ends and number-nonblank flags are set the '$' sign in blank lines will have the same line start as numbered lines. This shall be kept as a feature as it looks neater.
  • When flag show-nonprinting flag (-v) is set, non-ascii characters are printed as '^?'
  • Note: Untested on anything that is not a file, directory or stdin.

Implemented features

  • Read file
  • print file
  • Read from stdin and print
  • Handle input error
  • Options
    • -A, --show-all equivalent to -vET
    • -b, --number-nonblank
    • -e, equivalent to -vE
    • -E, --show-ends
    • -n, --number
    • -s, --squeeze blank
    • -t equivalent to -vT
    • -T, --show-tabs
    • -u (ignored)
    • -v, --show-nonprinting
  • Print actual control sequences instead of '^?' when show-nonprinting flag is set.
  • Add path (if there was one) to error messages

Issues

  • FIXED: cannot open non UTF-8 encoded files, e.g. opening a binary file produces an error.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages