| 1 |
package cmd |
| 2 |
|
| 3 |
import ( |
| 4 |
"time" |
| 5 |
|
| 6 |
"github.com/spf13/cobra" |
| 7 |
|
| 8 |
"github.com/miniscruff/changie/core" |
| 9 |
) |
| 10 |
|
| 11 |
// rootCmd represents the base command when called without any subcommands |
| 12 |
func RootCmd() *cobra.Command { |
| 13 |
cmd := &cobra.Command{ |
| 14 |
Use: "changie", |
| 15 |
Short: "changie handles conflict-free changelog management", |
| 16 |
Long: `Changie keeps your changes organized and attached to your code. |
| 17 |
|
| 18 |
Changie is aimed at seemlessly integrating into your release process while also |
| 19 |
being easy to use for developers and your release team.`, |
| 20 |
} |
| 21 |
cmd.SilenceUsage = true |
| 22 |
|
| 23 |
templateCache := core.NewTemplateCache() |
| 24 |
|
| 25 |
batch := NewBatch(time.Now, templateCache) |
| 26 |
merge := NewMerge(templateCache) |
| 27 |
|
| 28 |
cmd.AddCommand(batch.Command) |
| 29 |
cmd.AddCommand(NewGen().Command) |
| 30 |
cmd.AddCommand(NewInit().Command) |
| 31 |
cmd.AddCommand(NewLatest().Command) |
| 32 |
cmd.AddCommand(merge.Command) |
| 33 |
cmd.AddCommand(NewNew(time.Now, templateCache).Command) |
| 34 |
cmd.AddCommand(NewNext(templateCache).Command) |
| 35 |
cmd.AddCommand(NewDiff().Command) |
| 36 |
|
| 37 |
return cmd |
| 38 |
} |