2018-09-24 09:53:16 +02:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-10-31 07:14:33 +01:00
|
|
|
|
2018-11-17 06:21:39 +01:00
|
|
|
"github.com/photoprism/photoprism/internal/context"
|
2018-09-24 09:53:16 +02:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
2018-11-17 13:57:19 +01:00
|
|
|
// Prints current configuration
|
2018-09-24 09:53:16 +02:00
|
|
|
var ConfigCommand = cli.Command{
|
|
|
|
Name: "config",
|
|
|
|
Usage: "Displays global configuration values",
|
|
|
|
Action: configAction,
|
|
|
|
}
|
|
|
|
|
2018-11-17 06:21:39 +01:00
|
|
|
func configAction(ctx *cli.Context) error {
|
|
|
|
conf := context.NewConfig(ctx)
|
2018-09-24 09:53:16 +02:00
|
|
|
|
|
|
|
fmt.Printf("NAME VALUE\n")
|
2018-12-21 02:49:45 +01:00
|
|
|
fmt.Printf("debug %t\n", conf.Debug())
|
2018-12-21 02:43:44 +01:00
|
|
|
fmt.Printf("config-file %s\n", conf.ConfigFile())
|
2018-12-21 03:23:05 +01:00
|
|
|
fmt.Printf("darktable-cli %s\n", conf.DarktableCli())
|
2018-12-21 03:21:21 +01:00
|
|
|
fmt.Printf("originals-path %s\n", conf.OriginalsPath())
|
2018-12-21 03:21:49 +01:00
|
|
|
fmt.Printf("import-path %s\n", conf.ImportPath())
|
2018-12-21 03:22:25 +01:00
|
|
|
fmt.Printf("export-path %s\n", conf.ExportPath())
|
2018-12-21 03:23:47 +01:00
|
|
|
fmt.Printf("cache-path %s\n", conf.CachePath())
|
2018-12-21 03:25:09 +01:00
|
|
|
fmt.Printf("assets-path %s\n", conf.AssetsPath())
|
2018-12-21 03:18:43 +01:00
|
|
|
fmt.Printf("database-driver %s\n", conf.DatabaseDriver())
|
2018-12-21 03:19:25 +01:00
|
|
|
fmt.Printf("database-dsn %s\n", conf.DatabaseDsn())
|
2018-09-24 09:53:16 +02:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|