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