cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.65.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmd/pint/config.go

32lines · modecode

1package main
2
3import (
4 "fmt"
5 "os"
6
7 "github.com/cloudflare/pint/internal/config"
8
9 "github.com/urfave/cli/v2"
10)
11
12var configCmd = &cli.Command{
13 Name: "config",
14 Usage: "Parse and print used config.",
15 Action: actionConfig,
16}
17
18func actionConfig(c *cli.Context) (err error) {
19 err = initLogger(c.String(logLevelFlag), c.Bool(noColorFlag))
20 if err != nil {
21 return fmt.Errorf("failed to set log level: %w", err)
22 }
23
24 cfg, _, err := config.Load(c.Path(configFlag), c.IsSet(configFlag))
25 if err != nil {
26 return fmt.Errorf("failed to load config file %q: %w", c.Path(configFlag), err)
27 }
28
29 fmt.Fprintln(os.Stderr, cfg.String())
30
31 return nil
32}
33