Skip to content

Commit

Permalink
improve CLI help docs (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman authored Oct 21, 2021
1 parent 68b7c9e commit a1257e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 16 additions & 3 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,29 @@ import (

var createCmd = &cobra.Command{
Use: "create [PATH]",
Short: "generate a changelog",
Args: cobra.MaximumNArgs(1),
RunE: runCreate,
Short: "Generate a changelog from GitHub issues and PRs",
Long: `Generate a changelog from GitHub issues and PRs.
chronicle [flags] [PATH]
Create a changelog representing the changes from tag v0.14.0 until the present (for ./)
chronicle --since-tag v0.14.0
Create a changelog representing the changes from tag v0.14.0 until v0.18.0 (for ../path/to/repo)
chronicle --since-tag v0.14.0 --until-tag v0.18.0 ../path/to/repo
`,
Args: cobra.MaximumNArgs(1),
RunE: runCreate,
PreRunE: func(cmd *cobra.Command, args []string) error {
var repo = "./"
if len(args) == 1 {
if !git.IsRepository(args[0]) {
return fmt.Errorf("given path is not a git repository: %s", args[0])
}
repo = args[0]
} else {
log.Infof("no repository path given, assuming %q", repo)
}
appConfig.CliOptions.RepoPath = repo
return nil
Expand Down
4 changes: 2 additions & 2 deletions internal/config/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (cfg githubSummarizer) loadDefaultValues(v *viper.Viper) {
v.SetDefault("github.host", "github.com")
v.SetDefault("github.include-prs", false)
v.SetDefault("github.include-issues", true)
v.SetDefault("github.exclude-labels", []string{"duplicate", "question", "invalid", "wontfix"})
v.SetDefault("github.exclude-labels", []string{"duplicate", "question", "invalid", "wontfix", "wont-fix", "release-ignore", "changelog-ignore", "ignore"})
v.SetDefault("github.changes", []githubChange{
{
Type: "security-fixes",
Expand All @@ -60,7 +60,7 @@ func (cfg githubSummarizer) loadDefaultValues(v *viper.Viper) {
{
Type: "breaking-feature",
Title: "Breaking Changes",
Labels: []string{"breaking", "backwards-incompatible"},
Labels: []string{"breaking", "backwards-incompatible", "breaking-change", "breaking-feature"},
},
{
Type: "removed-feature",
Expand Down

0 comments on commit a1257e2

Please sign in to comment.