feat: hide interactive from when ask

Why? Because I don't use that feat
main
sudo pacman -Syu 2023-06-29 17:52:46 +07:00
parent bf0cd1bffd
commit 4dbdccfa43
3 changed files with 28 additions and 14 deletions

View File

@ -19,20 +19,21 @@ const (
type action struct { type action struct {
flags struct { flags struct {
scopes map[string]struct{} scopes map[string]struct{}
output string output string
from string from string
to string to string
version string version string
repository string repository string
filename string filename string
filetype string filetype string
verbose bool verbose bool
dryRun bool dryRun bool
interactive bool interactive bool
autoGitCommit bool interactiveFrom bool
autoGitTag bool autoGitCommit bool
autoGitPush bool autoGitTag bool
autoGitPush bool
} }
} }
@ -77,6 +78,7 @@ func (a *action) getFlags(c *cli.Context) {
a.flags.dryRun = c.Bool(flagDryRunName) a.flags.dryRun = c.Bool(flagDryRunName)
a.flags.interactive = c.Bool(flagInteractiveName) a.flags.interactive = c.Bool(flagInteractiveName)
a.flags.interactiveFrom = c.Bool(flagInteractiveFromName)
a.flags.autoGitCommit = c.Bool(flagAutoGitCommitName) a.flags.autoGitCommit = c.Bool(flagAutoGitCommitName)
a.flags.autoGitTag = c.Bool(flagAutoGitTagName) a.flags.autoGitTag = c.Bool(flagAutoGitTagName)
a.flags.autoGitPush = c.Bool(flagAutoGitPushName) a.flags.autoGitPush = c.Bool(flagAutoGitPushName)

View File

@ -42,6 +42,11 @@ func (a *action) RunGenerate(c *cli.Context) error {
fmt.Printf("Input version (%s):\n", flagVersionUsage) fmt.Printf("Input version (%s):\n", flagVersionUsage)
a.flags.version = ioe.ReadInput() a.flags.version = ioe.ReadInput()
if a.flags.interactiveFrom {
fmt.Printf("Input from (%s):\n", flagFromUsage)
a.flags.from = ioe.ReadInputEmpty()
}
fmt.Printf("Input to (%s):\n", flagToUsage) fmt.Printf("Input to (%s):\n", flagToUsage)
a.flags.to = ioe.ReadInputEmpty() a.flags.to = ioe.ReadInputEmpty()
} }

View File

@ -48,6 +48,9 @@ const (
flagInteractiveName = "interactive" flagInteractiveName = "interactive"
flagInteractiveUsage = "interactive mode" flagInteractiveUsage = "interactive mode"
flagInteractiveFromName = "interactive-from"
flagInteractiveFromUsage = "enable ask from in interactive mode"
flagAutoGitCommitName = "auto-commit" flagAutoGitCommitName = "auto-commit"
flagAutoGitCommitUsage = "enable auto git commit after generating changelog" flagAutoGitCommitUsage = "enable auto git commit after generating changelog"
@ -126,6 +129,10 @@ func NewApp() *App {
Usage: flagInteractiveUsage, Usage: flagInteractiveUsage,
Aliases: flagInteractiveAliases, Aliases: flagInteractiveAliases,
}, },
&cli.BoolFlag{
Name: flagInteractiveFromName,
Usage: flagInteractiveFromUsage,
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: flagAutoGitCommitName, Name: flagAutoGitCommitName,
Usage: flagAutoGitCommitUsage, Usage: flagAutoGitCommitUsage,