mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-02 21:32:34 +00:00
Add debug output for config
This commit is contained in:
21
main.go
21
main.go
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user