upd CHANGELOG, README

This commit is contained in:
onyx-and-iris 2025-04-13 14:23:57 +01:00
parent 23ec3b85c1
commit 2fa49d0dd0
5 changed files with 50 additions and 21 deletions

View File

@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# [0.5.0] - 2025-04-13
### Changed
- CLI component migrated to Cobra. This introduces the following changes:
- `list` is now a subcommand.
- `create` has been added as a subcommand, use it to create a new .gitignore file.
- Env var `GIGNORE_TEMPLATE_DIR` changed to `GIGNORE_TEMPLATE_ROOT`
- Env var `GIGNORE_LOGLEVEL` may now be used to set the logging level.
# [0.4.0] - 2025-04-05
### Changed

View File

@ -3,7 +3,7 @@
![macOS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=macos&logoColor=F0F0F0)
# Gignore - Generate .gitinore files
# Gignore - Generate .gitignore files
## Install
@ -23,23 +23,28 @@ task install
## Usage
```bash
Usage of gignore:
gignore [flags] <template>
Usage:
gignore [flags]
gignore [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
create Create a new .gitignore file
help Help about any command
list List all .gitignore files in the current directory
Flags:
-dir string
directory containing .gitignore templates (default "gitignoreio")
-l int
log level (shorthand) (default 3)
-list
list available templates
-loglevel int
log level (default 3)
-ls
list available templates (shorthand)
-h, --help help for gignore
-l, --loglevel string Log level (trace, debug, info, warn, error, fatal, panic) (default "info")
-r, --root string Root directory to search for .gitignore files (default "gitignoreio")
Example:
gignore go
Use "gignore [command] --help" for more information about a command.
```
For example:
```bash
gignore create go
```
## Custom Templates
@ -49,10 +54,10 @@ It's possible to add your own custom templates, simply create a directory in `in
Then pass the dir name as a flag, for example:
```bash
gignore -dir=custom go
gignore -root=custom create go
```
You may set an environment variable `GIGNORE_TEMPLATE_DIR` to avoid passing the `-dir` flag each time.
You may set an environment variable `GIGNORE_TEMPLATE_ROOT` to avoid passing the `-root` flag each time.
If a template is requested but not found in the custom directory then the gitignoreio registry will act as a fallback.
@ -73,7 +78,7 @@ Acceptable values for this flag are:
For example, to set the log level to `debug`, you can use:
```bash
gignore -loglevel=debug -dir=custom go
gignore -loglevel=debug create python
```
The default log level is `warn` if the flag is not specified.

View File

@ -42,7 +42,7 @@ tasks:
cmds:
- go generate ./...
status:
- ls internal/registry/templates/gitignoreio/*.gitignore >/dev/null || exit 1
- ls internal/registry/templates/gitignoreio/*.gitignore >/dev/null
build-windows:
desc: Build the gignore project for Windows

7
go.mod
View File

@ -5,6 +5,11 @@ go 1.24.0
require (
github.com/cuonglm/gogi v1.0.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.9.1
)
require golang.org/x/sys v0.32.0 // indirect
require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
golang.org/x/sys v0.32.0 // indirect
)

11
go.sum
View File

@ -1,12 +1,20 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/cuonglm/gogi v1.0.1 h1:Jotx6uAfFK6YHFOOek37R9y3Ae9qp/nUt/3mYGCl+44=
github.com/cuonglm/gogi v1.0.1/go.mod h1:ZLU5wl3d+FSSkiYYDpmPJI2dWdAGj8q28rFjpeWv1g4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@ -14,5 +22,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=