diff --git a/internal/commands/show.go b/internal/commands/show.go index f2a14fafb..b947a43c6 100644 --- a/internal/commands/show.go +++ b/internal/commands/show.go @@ -10,10 +10,10 @@ var ShowCommand = cli.Command{ Usage: "Shows supported formats, features, and config options", Subcommands: []cli.Command{ ShowConfigCommand, - ShowFlagsCommand, - ShowOptionsCommand, - ShowFiltersCommand, - ShowFormatsCommand, - ShowTagsCommand, + ShowConfigOptionsCommand, + ShowConfigYamlCommand, + ShowSearchFiltersCommand, + ShowFileFormatsCommand, + ShowMetadataCommand, }, } diff --git a/internal/commands/show_flags.go b/internal/commands/show_config_options.go similarity index 88% rename from internal/commands/show_flags.go rename to internal/commands/show_config_options.go index 19fd29fee..dee2edebc 100644 --- a/internal/commands/show_flags.go +++ b/internal/commands/show_config_options.go @@ -10,13 +10,12 @@ import ( "github.com/photoprism/photoprism/pkg/report" ) -// ShowFlagsCommand configures the command name, flags, and action. -var ShowFlagsCommand = cli.Command{ - Name: "flags", - Aliases: []string{"env", "vars"}, - Usage: "Displays supported environment variables and CLI flags", - Flags: report.CliFlags, - Action: showFlagsAction, +// ShowConfigOptionsCommand configures the command name, flags, and action. +var ShowConfigOptionsCommand = cli.Command{ + Name: "config-options", + Usage: "Displays supported environment variables and CLI flags", + Flags: report.CliFlags, + Action: showConfigOptionsAction, } var faceFlagsInfo = `!!! info "" @@ -24,8 +23,8 @@ var faceFlagsInfo = `!!! info "" We recommend that only advanced users change these parameters:` -// showFlagsAction displays supported environment variables and CLI flags. -func showFlagsAction(ctx *cli.Context) error { +// showConfigOptionsAction displays supported environment variables and CLI flags. +func showConfigOptionsAction(ctx *cli.Context) error { conf := config.NewConfig(ctx) conf.SetLogLevel(logrus.FatalLevel) diff --git a/internal/commands/show_options.go b/internal/commands/show_config_yaml.go similarity index 87% rename from internal/commands/show_options.go rename to internal/commands/show_config_yaml.go index 41b3a86af..4c2ffbeed 100644 --- a/internal/commands/show_options.go +++ b/internal/commands/show_config_yaml.go @@ -10,16 +10,16 @@ import ( "github.com/photoprism/photoprism/pkg/report" ) -// ShowOptionsCommand configures the command name, flags, and action. -var ShowOptionsCommand = cli.Command{ - Name: "options", +// ShowConfigYamlCommand configures the command name, flags, and action. +var ShowConfigYamlCommand = cli.Command{ + Name: "config-yaml", Usage: "Displays supported YAML config options and CLI flags", Flags: report.CliFlags, - Action: showOptionsAction, + Action: showConfigYamlAction, } -// showOptionsAction displays supported YAML config options and CLI flag. -func showOptionsAction(ctx *cli.Context) error { +// showConfigYamlAction displays supported YAML config options and CLI flag. +func showConfigYamlAction(ctx *cli.Context) error { conf := config.NewConfig(ctx) conf.SetLogLevel(logrus.TraceLevel) diff --git a/internal/commands/show_formats.go b/internal/commands/show_file_formats.go similarity index 57% rename from internal/commands/show_formats.go rename to internal/commands/show_file_formats.go index 9b9d5ebf2..b45b7b0f1 100644 --- a/internal/commands/show_formats.go +++ b/internal/commands/show_file_formats.go @@ -10,20 +10,19 @@ import ( "github.com/photoprism/photoprism/pkg/report" ) -// ShowFormatsCommand configures the command name, flags, and action. -var ShowFormatsCommand = cli.Command{ - Name: "formats", - Aliases: []string{"filetypes"}, - Usage: "Displays supported media and sidecar file formats", +// ShowFileFormatsCommand configures the command name, flags, and action. +var ShowFileFormatsCommand = cli.Command{ + Name: "file-formats", + Usage: "Displays supported media and sidecar file formats", Flags: append(report.CliFlags, cli.BoolFlag{ Name: "short, s", Usage: "hide format descriptions", }), - Action: showFormatsAction, + Action: showFileFormatsAction, } -// showFormatsAction lists supported media and sidecar file formats. -func showFormatsAction(ctx *cli.Context) error { +// showFileFormatsAction lists supported media and sidecar file formats. +func showFileFormatsAction(ctx *cli.Context) error { rows, cols := media.Report(fs.Extensions.Types(true), !ctx.Bool("short"), true, true) result, err := report.RenderFormat(rows, cols, report.CliFormat(ctx)) diff --git a/internal/commands/show_tags.go b/internal/commands/show_metadata.go similarity index 74% rename from internal/commands/show_tags.go rename to internal/commands/show_metadata.go index 1ce6a6cdc..93090d92b 100644 --- a/internal/commands/show_tags.go +++ b/internal/commands/show_metadata.go @@ -10,20 +10,19 @@ import ( "github.com/photoprism/photoprism/pkg/report" ) -// ShowTagsCommand configures the command name, flags, and action. -var ShowTagsCommand = cli.Command{ - Name: "tags", - Aliases: []string{"metadata"}, - Usage: "Displays supported metadata tags and standards", +// ShowMetadataCommand configures the command name, flags, and action. +var ShowMetadataCommand = cli.Command{ + Name: "metadata", + Usage: "Displays supported metadata tags and standards", Flags: append(report.CliFlags, cli.BoolFlag{ Name: "short, s", Usage: "hide links to documentation", }), - Action: showTagsAction, + Action: showMetadataAction, } -// showTagsAction reports supported Exif and XMP metadata tags. -func showTagsAction(ctx *cli.Context) error { +// showMetadataAction reports supported Exif and XMP metadata tags. +func showMetadataAction(ctx *cli.Context) error { rows, cols := meta.Report(&meta.Data{}) // Sort rows by type data type and name. diff --git a/internal/commands/show_filters.go b/internal/commands/show_search_filters.go similarity index 55% rename from internal/commands/show_filters.go rename to internal/commands/show_search_filters.go index a47206f96..6de92b3b6 100644 --- a/internal/commands/show_filters.go +++ b/internal/commands/show_search_filters.go @@ -10,17 +10,16 @@ import ( "github.com/photoprism/photoprism/pkg/report" ) -// ShowFiltersCommand configures the command name, flags, and action. -var ShowFiltersCommand = cli.Command{ - Name: "filters", - Aliases: []string{"search"}, - Usage: "Displays supported search filters with examples", - Flags: report.CliFlags, - Action: showFiltersAction, +// ShowSearchFiltersCommand configures the command name, flags, and action. +var ShowSearchFiltersCommand = cli.Command{ + Name: "search-filters", + Usage: "Displays supported search filters with examples", + Flags: report.CliFlags, + Action: showSearchFiltersAction, } -// showFiltersAction displays a search filter overview with examples. -func showFiltersAction(ctx *cli.Context) error { +// showSearchFiltersAction displays a search filter overview with examples. +func showSearchFiltersAction(ctx *cli.Context) error { rows, cols := form.Report(&form.SearchPhotos{}) sort.Slice(rows, func(i, j int) bool { diff --git a/internal/commands/show_test.go b/internal/commands/show_test.go index 71773c879..a739c9e3b 100644 --- a/internal/commands/show_test.go +++ b/internal/commands/show_test.go @@ -38,7 +38,7 @@ func TestShowTagsCommand(t *testing.T) { ctx := config.CliTestContext() output := capture.Output(func() { - err = ShowTagsCommand.Run(ctx) + err = ShowMetadataCommand.Run(ctx) }) if err != nil { @@ -59,7 +59,7 @@ func TestShowFiltersCommand(t *testing.T) { ctx := config.CliTestContext() output := capture.Output(func() { - err = ShowFiltersCommand.Run(ctx) + err = ShowSearchFiltersCommand.Run(ctx) }) if err != nil { @@ -80,7 +80,7 @@ func TestShowFormatsCommand(t *testing.T) { ctx := config.CliTestContext() output := capture.Output(func() { - err = ShowFormatsCommand.Run(ctx) + err = ShowFileFormatsCommand.Run(ctx) }) if err != nil {