0096243240
Replaces the --no-wrap flag with --md in all "photoprism show ..." subcommands, as this is easier to understand. See also #2247. Unused code was opportunistically removed along the way.
35 lines
716 B
Go
35 lines
716 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/urfave/cli"
|
|
|
|
"github.com/photoprism/photoprism/internal/config"
|
|
"github.com/photoprism/photoprism/pkg/report"
|
|
)
|
|
|
|
var ShowConfigCommand = cli.Command{
|
|
Name: "config",
|
|
Usage: "Shows global config option names and values",
|
|
Flags: []cli.Flag{
|
|
cli.BoolFlag{
|
|
Name: "md, m",
|
|
Usage: "renders valid Markdown",
|
|
},
|
|
},
|
|
Action: showConfigAction,
|
|
}
|
|
|
|
// showConfigAction lists configuration options and their values.
|
|
func showConfigAction(ctx *cli.Context) error {
|
|
conf := config.NewConfig(ctx)
|
|
conf.SetLogLevel(logrus.FatalLevel)
|
|
|
|
rows, cols := conf.Report()
|
|
|
|
fmt.Println(report.Table(rows, cols, ctx.Bool("md")))
|
|
|
|
return nil
|
|
}
|