https://github.com/lordvidex/gomeasure
a CLI tool for project analysis
https://github.com/lordvidex/gomeasure
cli cobra golang viper
Last synced: 6 months ago
JSON representation
a CLI tool for project analysis
- Host: GitHub
- URL: https://github.com/lordvidex/gomeasure
- Owner: lordvidex
- License: mit
- Created: 2022-09-25T11:55:00.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-10T00:27:10.000Z (over 3 years ago)
- Last Synced: 2024-06-20T05:14:24.053Z (about 2 years ago)
- Topics: cli, cobra, golang, viper
- Language: Go
- Homepage:
- Size: 9.94 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## gomeasure
gomeasure is a CLI tool that measures the lines of code and the count of files in a directory or project
## Installation
### Build yourself
This project is open source. You can simply clone this repo and build using:
```shell
go build -o bin/gomeasure main.go
```
### Download releases
Checkout the most updated releases [here](https://github.com/lordvidex/gomeasure/releases/) and download the binary that corresponds to your operating system
### MacOS (homebrew)
1. Using homebrew
```bash
$ brew tap lordvidex/lordvidex
$ brew install gomeasure
$ gomeasure --version # to confirm
```
### Debian (amd64)
1. To **install** on debian distributions copy and paste the following command in your terminal
```bash
curl "https://raw.githubusercontent.com/lordvidex/gomeasure/master/scripts/install.sh" | sh
```
### Docker usage (new)
You can use the docker image to run gomeasure.
```bash
docker run --rm -v $(pwd):/app ghcr.io/lordvidex/gomeasure:alpine line /app
```
#### How to Use
- The `-v` argument is used to mount the directory to be measured to the container's `/app` directory. Therefore, to measure any directory instead of the current directory, you can replace `$(pwd)` with the path to the directory you want to measure.
- The `--rm` argument is used to remove the container after the command is executed to prevent dangling containers.
- All arguments after the image name are passed to the gomeasure command.
- The `/app` should not be replaced because source directory is mapped to `/app` in the container.
## Uninstall
### Debian (amd64)
1. To **uninstall** on debian distributions copy and paste the following command in your terminal
```bash
curl "https://raw.githubusercontent.com/lordvidex/gomeasure/master/scripts/uninstall.sh" | sh
```
## Usage
```bash
gomeasure --help
```
### Configuration File
gomeasure uses a configuration file to make it easier to fine tune the CLI flags.
gomeasure looks for a file named `.gomeasure.yaml` in the current directory. If it doesn't find it, it looks for it in the home directory. If no configuration file is found, it uses the default values.
Note that the priority of the configurations are as follows:
1. CLI flags (highest priority)
2. Configuration file (in current directory)
3. Configuration file (in home directory)
4. Default values (lowest priority)
Checkout the [example configuration file](./example/.gomeasure.yaml) to get started.
## DISCLAIMER:
Normally, the program reads all kinds of file and returns the number of lines in each of them. Therefore, it is up to the developer to filter out the files to be scanned with
flags `-i` and `-I`.