mirror of
https://github.com/photoprism/photoprism.git
synced 2025-09-26 21:01:58 +08:00
31 lines
754 B
Go
31 lines
754 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
"github.com/photoprism/photoprism/internal/entity"
|
|
"github.com/photoprism/photoprism/pkg/txt/report"
|
|
)
|
|
|
|
// ShowSourcesCommand configures the command name, flags, and action.
|
|
var ShowSourcesCommand = &cli.Command{
|
|
Name: "sources",
|
|
Usage: "Displays supported metadata sources and their priorities",
|
|
Flags: append(report.CliFlags),
|
|
Action: showSourcesAction,
|
|
}
|
|
|
|
// showSourcesAction displays supported metadata sources.
|
|
func showSourcesAction(ctx *cli.Context) error {
|
|
rows, cols := entity.SrcPriority.Report()
|
|
format, ferr := report.CliFormatStrict(ctx)
|
|
if ferr != nil {
|
|
return ferr
|
|
}
|
|
result, err := report.RenderFormat(rows, cols, format)
|
|
fmt.Println(result)
|
|
return err
|
|
}
|