Skip to content

Commit

Permalink
Merge pull request #15 from muandane/hotfix/helpflag
Browse files Browse the repository at this point in the history
Hotfix/helpflag
  • Loading branch information
muandane authored Nov 13, 2023
2 parents 932dd7a + 06ff487 commit 580fa45
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ You can skip questions by adding them in `"SkipQuestions"`

Only `"Scopes"` question can be skipped since it's optional according to the [Commit Spec](https://www.conventionalcommits.org/en/v1.0.0/)

If you don't want the interactive screen you can use the flags to construct a message:

```sh

goji --type feat --scope home --message "Add home page"

```

## License

Apache 2.0 license [Zine El Abidine Moualhi](https://www.linkedin.com/in/zinemoualhi/)
Expand Down
2 changes: 2 additions & 0 deletions src/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ builds:
- CGO_ENABLED=0
flags:
- -mod=vendor
ldflags:
- -s -w -X main.version={{.Version}}

release:
prerelease: auto
Expand Down
11 changes: 9 additions & 2 deletions src/cmd/goji.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ import (
"github.com/fatih/color"
)

var (
version = ""
)

func init() {
}

func main() {
version := "0.0.1-rc4"

helpFlag := flag.Bool("h", false, "Display help information")
flag.BoolVar(helpFlag, "help", false, "display help")
versionFlag := flag.Bool("v", false, "Display version information")
Expand All @@ -38,8 +42,11 @@ func main() {
fmt.Println()
fmt.Println("Help information:")
fmt.Println(" -h --help: Display help information")
fmt.Println(" -v --version: Display version information")
fmt.Println(" -i --init: Generate a configuration file")
fmt.Println(" -m --message: Specify a commit message")
fmt.Println(" -s --scope: Specify a custom scope")
fmt.Println(" -t --type: Specify the type from the config file")
fmt.Println(" -v --version: Display version information")
return
}

Expand Down

0 comments on commit 580fa45

Please sign in to comment.