Add debug output for config

This commit is contained in:
Manuel Rüger
2023-05-03 15:59:18 +02:00
parent 51accf008f
commit 2b756daf37
6 changed files with 22 additions and 11 deletions

21
main.go
View File

@@ -28,11 +28,12 @@ const (
var flags = []cli.Flag{
altsrc.NewStringFlag(&cli.StringFlag{
Name: "files",
Aliases: []string{"f"},
Value: "",
Usage: "use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted).",
EnvVars: []string{"MARK_FILES"},
Name: "files",
Aliases: []string{"f"},
Value: "",
Usage: "use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted).",
TakesFile: true,
EnvVars: []string{"MARK_FILES"},
}),
altsrc.NewBoolFlag(&cli.BoolFlag{
Name: "compile-only",
@@ -219,6 +220,16 @@ func RunMark(cCtx *cli.Context) error {
}
}
log.Debug("config:")
for _, f := range cCtx.Command.Flags {
flag := f.Names()
if flag[0] == "password" {
log.Debugf(nil, "%20s: %v", flag[0], "******")
} else {
log.Debugf(nil, "%20s: %v", flag[0], cCtx.Value(flag[0]))
}
}
// Loop through files matched by glob pattern
for _, file := range files {
log.Infof(