8000 GitHub - zandacw/charcnt: CLI utility to show most common characters in a directory
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

zandacw/charcnt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Character Count CLI

Overview

This command-line interface (CLI) tool analyzes the character frequency in files within a specified directory and optionally filters by file type. It generates a sideways bar chart in the terminal to visualize the most common characters.

Screenshot

Installation

Ensure you have Go installed. Clone the repository and navigate to the project directory:

git clone github.com/zandacw/charcnt
cd github.com/zandacw/charcnt 

Install dependencies:

go mod tidy

Build and install:

go install

Usage

charcnt [option] dirpath

Options

  • filetype: Specify the file type to count characters on (default: * for all files).
  • width: Maximum width of the bar chart (default: 80)

Example

charcnt .
charcnt -filetype=go -width=160 /path/to/directory

Output

The CLI outputs a sideways bar chart where each character is represented by its frequency. Characters are color-coded based on type:

  • Red: Digits (0-9)
  • Blue: Alphabetic (A-Z, a-z)
  • Green: Symbols
  • White: Punctuation

Note

This is a silly tool with no optimisations. Might blow up your machine if run on a massively nested directory :(

Acknowledgements

  • Uses github.com/fatih/color for terminal colors

About

CLI utility to show most common characters in a directory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0