From 2b756daf37fc82d592273e361e3ccf1fe025b272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Wed, 3 May 2023 15:59:18 +0200 Subject: [PATCH] Add debug output for config --- .github/workflows/ci.yml | 2 +- .github/workflows/goreleaser.yml | 2 +- Dockerfile | 2 +- go.mod | 2 +- go.sum | 4 ++-- main.go | 21 ++++++++++++++++----- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af61d3c3..cc95fa3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: - master env: - GO_VERSION: "~1.20.3" + GO_VERSION: "~1.20.4" jobs: # Runs Golangci-lint on the source code diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 55fbffa2..5c3422fa 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Set Up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "1.20" - name: Run GoReleaser diff --git a/Dockerfile b/Dockerfile index 17fe6a6c..10e6fe00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20.3 as builder +FROM golang:1.20.4 as builder ENV GOPATH="/go" WORKDIR /go/src/github.com/kovetskiy/mark COPY / . diff --git a/go.mod b/go.mod index a6701e89..37c8f2c7 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/reconquest/pkg v1.3.0 github.com/reconquest/regexputil-go v0.0.0-20160905154124-38573e70c1f4 github.com/stretchr/testify v1.8.2 - github.com/urfave/cli/v2 v2.25.1 + github.com/urfave/cli/v2 v2.25.3 github.com/yuin/goldmark v1.5.4 golang.org/x/tools v0.8.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 51c97643..619a5f6e 100644 --- a/go.sum +++ b/go.sum @@ -63,8 +63,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= -github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.25.3 h1:VJkt6wvEBOoSjPFQvOkv6iWIrsJyCrKGtCtxXWwmGeY= +github.com/urfave/cli/v2 v2.25.3/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU= diff --git a/main.go b/main.go index 59c5606c..4a9b5258 100644 --- a/main.go +++ b/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(