You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ccat/README.md

54 lines
1.9 KiB
Markdown

2 months ago
## ccat
2 months ago
ccat is a file printing tool (like 'cat') which uses Regular Expressions to enable syntax highlighting.
2 months ago
---
### Features
2 months ago
- 11 colors out-of-the-box: Red, Blue, Green, Magenta, Cyan, Black, White, Yellow, Gray, Orange and Dark Blue.
- Support for defining custom colors via the `ccat.colors` file.
2 months ago
- Regex-color mappings are stored in configuration files.
- Uses the file extension to determine which configuration file to use.
- Highly extensible - to add a config file for an specific file type, name the file `<extension>.conf`.
- Support for printing line numbers with the `-n` flag.
- Statically linked Go binary - no runtime dependencies, config files are distributed along with the binary.
- Cross-platform
---
### Installing
If you have the `go` command installed, run `make` after cloning the repository.
2 months ago
---
2 months ago
### Getting Started
The config files are embedded within the binary. They will automatically be installed to the correct location (`%APPDATA/ccat` on Windows, `~/.config/ccat` on UNIX) when the program is first run.
2 months ago
2 months ago
As written above, if provided a file with extension `.example`, the program will look for the config file named `example.conf`. If such a file doesn't exist, the file is printed out without any highlighting.
---
### Config Files
2 months ago
The config files are written in YAML. Each line has the following syntax:
2 months ago
2 months ago
`"<regex>": COLOR`
2 months ago
Note that the regex must be enclosed in double quotes, and the color must be capitalized.
2 months ago
---
2 months ago
### Custom Colors
To define a color of your own, create a file named `ccat.colors` in the config directory (mentioned above). The syntax of this file is the following:
`COLOR: <red> <green> <blue>`
Note that the color name must be capitalized (and shouldn't contain spaces). The RGB values must each be from 0 to 255.
---
2 months ago
### TODO:
2 months ago
- Allow users to provide a config file in the command-line, overriding the extension-based config file.
2 months ago
- Provide releases.