feat: init interactive mode

main
sudo pacman -Syu 2022-02-07 23:10:53 +07:00
parent 3f0c224c79
commit dc83425d11
3 changed files with 14 additions and 1 deletions

1
go.mod
View File

@ -6,6 +6,7 @@ require (
github.com/go-git/go-git/v5 v5.4.2
github.com/haunt98/clock-go v0.3.0
github.com/make-go-great/color-go v0.3.0
github.com/make-go-great/ioe-go v0.4.0
github.com/make-go-great/markdown-go v0.5.0
github.com/make-go-great/rst-go v0.3.0
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e

2
go.sum
View File

@ -59,6 +59,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/make-go-great/color-go v0.3.0 h1:ZVtVk/wVVsZZwSJG7PZpsY5zwIyGao5VoN48yKfSzYA=
github.com/make-go-great/color-go v0.3.0/go.mod h1:G5G8IJ3PUo+vSQ+UvnfaswF8O/piVIhFJKv1mQjBGpI=
github.com/make-go-great/ioe-go v0.4.0 h1:abRH8J01am7A9VsinEG0WnXDiT1CWk7Cd0auRvWuNyQ=
github.com/make-go-great/ioe-go v0.4.0/go.mod h1:RMXnZIKVXk52+H7EJZoBpZ3SSuxUPk9UFqpHFZ9uOUk=
github.com/make-go-great/markdown-go v0.5.0 h1:Tt/0i3/X02x4EW1mhSvTaqd0K+ElmfuscLTfEfpAWF4=
github.com/make-go-great/markdown-go v0.5.0/go.mod h1:0vY248a4ZvnC90Tjj8/hI1hWYZc5K0fGi4f1z/VEEOg=
github.com/make-go-great/rst-go v0.3.0 h1:by5GL6++R9DHs+nM7k+DQirrL6o/cNr96MHAskvsn5c=

View File

@ -10,6 +10,7 @@ import (
"github.com/haunt98/changeloguru/internal/changelog"
"github.com/haunt98/changeloguru/internal/convention"
"github.com/haunt98/changeloguru/internal/git"
"github.com/make-go-great/ioe-go"
"github.com/make-go-great/markdown-go"
"github.com/make-go-great/rst-go"
"github.com/pkg/diff"
@ -27,7 +28,16 @@ func (a *action) RunGenerate(c *cli.Context) error {
return cli.ShowAppHelp(c)
}
} else {
// TODO: add interactive mode
fmt.Printf("Input version (%s):\n", usageVersion)
a.flags.version = ioe.ReadInput()
fmt.Printf("Input from (%s):\n", usageFrom)
a.flags.from = ioe.ReadInputEmpty()
fmt.Printf("Input to (%s):\n", usageTo)
a.flags.to = ioe.ReadInputEmpty()
// TODO: support more flags
}
commits, err := a.getCommits()