chore: no need to check flag when use a.log()
parent
6392d7ba4d
commit
146497ac8b
|
@ -52,10 +52,8 @@ func (a *action) getFlags(c *cli.Context) {
|
||||||
a.flags.filetype = a.getFlagValue(c, filetypeFlag, defaultFiletype)
|
a.flags.filetype = a.getFlagValue(c, filetypeFlag, defaultFiletype)
|
||||||
a.flags.dryRun = c.Bool(dryRunFlag)
|
a.flags.dryRun = c.Bool(dryRunFlag)
|
||||||
|
|
||||||
if a.flags.verbose {
|
|
||||||
a.log("flags %+v", a.flags)
|
a.log("flags %+v", a.flags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func (a *action) getFlagValue(c *cli.Context, flag, fallback string) string {
|
func (a *action) getFlagValue(c *cli.Context, flag, fallback string) string {
|
||||||
value := c.String(flag)
|
value := c.String(flag)
|
||||||
|
|
|
@ -83,6 +83,8 @@ func (a *action) getRealOutput() string {
|
||||||
nameWithExt := a.flags.filename + "." + a.flags.filetype
|
nameWithExt := a.flags.filename + "." + a.flags.filetype
|
||||||
realOutput := filepath.Join(a.flags.output, nameWithExt)
|
realOutput := filepath.Join(a.flags.output, nameWithExt)
|
||||||
|
|
||||||
|
a.log("real output %s", realOutput)
|
||||||
|
|
||||||
return realOutput
|
return realOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue