9 Commits

6 changed files with 22 additions and 6 deletions

8
LICENSE.md Normal file
View File

@@ -0,0 +1,8 @@
Copyright 2025 Aadhavan Srinivasan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -17,6 +17,15 @@ ccat is a file printing tool (like 'cat') which uses Regular Expressions to enab
---
### Installing
Download the appropriate zip-file from the 'Releases' section. Place the executable in your PATH.
NOTE: The releases are not available on the GitHub repo (which is a mirror of https://gitea.twomorecents.org/Rockingcool/ccat). Obtain the [releases](https://gitea.twomorecents.org/Rockingcool/ccat/releases) from there instead.
---
### Building from source
If you have the `go` command installed, run `make` after cloning the repository.
---
@@ -27,7 +36,6 @@ The following languages have config files included by default:
- C
- Go
-
---
@@ -63,4 +71,3 @@ Note that the color name must be capitalized (and shouldn't contain spaces). The
### TODO:
- Windows support.
- Allow users to provide a config file in the command-line, overriding the extension-based config file.
- Provide releases.

View File

@@ -1,9 +1,9 @@
package main
import (
"ccat/stack"
"embed"
"errors"
"gitea.twomorecents.org/Rockingcool/ccat/stack"
"io/fs"
"os"
"path/filepath"

View File

@@ -10,11 +10,13 @@
# Strings in double quotes and single quotes
'"(.*?)"': BLUE
"'(.)'": BLUE
# Text inside angle-brackets (used in 'include' statements)
'\<(.*?)\>': BLUE
# Assignments and comparisons
# TODO: Add less than, greater than, not equal to, and struct pointer member access
'(?:\s|\b)(=|==|!=|<=|>=|\->)(\s|\b)' : CYAN
# Keywords
'\b(if|else|while|do|for|return)\b': CYAN
'^(#ifdef|#ifndef|#define|#include)\b': CYAN
'(\n|^)(#ifdef|#ifndef|#define|#include)\b': CYAN
# Data Types
'\b(int|char|float|double|void|long|short|unsigned|signed|bool)\b': YELLOW

2
go.mod
View File

@@ -1,4 +1,4 @@
module ccat
module gitea.twomorecents.org/Rockingcool/ccat
go 1.22.5

View File

@@ -1,5 +1,4 @@
1. Man page
2. README for GitHub Repo
2. Logging
3. Coloring functions
4. Flag to list all available colors for your terminal - some terminals will only support the predefined colors.