photoprism/internal/config/cli_flags_report.go
Michael Mayer e739dd3e89 Auth: Add support for config and routing extensions (WIP) #782 #2478
Enables developers to extend the existing config and API. Initial proof
of concept and work in progress. Implementation details may change.
Feedback welcome!

Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-07-05 23:13:34 +02:00

19 lines
441 B
Go

package config
// Report returns global config values as a table for reporting.
func (f CliFlags) Report() (rows [][]string, cols []string) {
cols = []string{"Environment", "CLI Flag", "Default", "Description"}
rows = make([][]string, 0, len(f))
for _, flag := range Flags {
if flag.Hidden() {
continue
}
rows = append(rows, []string{flag.EnvVar(), flag.CommandFlag(), flag.Default(), flag.Usage()})
}
return rows, cols
}