rat

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 12 Imported by: 0

README

rat

ci GitHub go.mod Go version (subdirectory of monorepo) GitHub tag (with filter)

Writing a cat (and bat) clone in Go for learning purposes

Installation

Installation of it requires the Go toolchain.

$ go install github.com/Yakiyo/rat

or the repository can be locally cloned and installed too.

$ git clone https://github.com/Yakiyo/rat

$ cd rat

$ go build .

Usage

It works similar to cat

# pretty print a js file
$ rat index.js

# print multiple files of different language
$ rat index.js main.go

# implicitly mention language to use
$ rat --language typescript index.js

# choose a style
$ rat --style githubdark main.cpp

# read from stdin
$ echo "console.log('hello')" | rat

# first print README, then use stdin and then index.js
$ rat README.md - index.js

# disable pretty printing (print plain text)
$ rat --style none app.py

For syntax highlighting, the chroma library is used. A list of supported languages can be found here. All available chroma styles can be viewed at the styles gallery.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL