Metadata: Improve CLI command descriptions #1736

This commit is contained in:
Michael Mayer
2021-11-18 03:02:10 +01:00
parent 73ffa53397
commit 9da2e92fb6
12 changed files with 18 additions and 19 deletions

View File

@@ -5,7 +5,6 @@ import (
"time" "time"
"github.com/dustin/go-humanize/english" "github.com/dustin/go-humanize/english"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/config" "github.com/photoprism/photoprism/internal/config"
@@ -16,7 +15,7 @@ import (
// CleanUpCommand registers the cleanup command. // CleanUpCommand registers the cleanup command.
var CleanUpCommand = cli.Command{ var CleanUpCommand = cli.Command{
Name: "cleanup", Name: "cleanup",
Usage: "Removes orphan index entries and thumbnails", Usage: "Removes orphan index entries and thumbnail files",
Flags: cleanUpFlags, Flags: cleanUpFlags,
Action: cleanUpAction, Action: cleanUpAction,
} }
@@ -45,7 +44,7 @@ func cleanUpAction(ctx *cli.Context) error {
conf.InitDb() conf.InitDb()
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("cleanup: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
w := service.CleanUp() w := service.CleanUp()

View File

@@ -16,7 +16,7 @@ import (
// ConvertCommand registers the convert cli command. // ConvertCommand registers the convert cli command.
var ConvertCommand = cli.Command{ var ConvertCommand = cli.Command{
Name: "convert", Name: "convert",
Usage: "Transcodes files in other formats to JPEG / AVC", Usage: "Transcodes other formats to JPEG and AVC",
ArgsUsage: "[path]", ArgsUsage: "[path]",
Action: convertAction, Action: convertAction,
} }

View File

@@ -245,7 +245,7 @@ func facesIndexAction(ctx *cli.Context) error {
} }
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("index: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
var indexed fs.Done var indexed fs.Done

View File

@@ -63,7 +63,7 @@ func indexAction(ctx *cli.Context) error {
} }
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("index: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
var indexed fs.Done var indexed fs.Done

View File

@@ -34,7 +34,7 @@ func momentsAction(ctx *cli.Context) error {
conf.InitDb() conf.InitDb()
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("moments: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
w := service.Moments() w := service.Moments()

View File

@@ -14,11 +14,11 @@ import (
// OptimizeCommand registers the index cli command. // OptimizeCommand registers the index cli command.
var OptimizeCommand = cli.Command{ var OptimizeCommand = cli.Command{
Name: "optimize", Name: "optimize",
Usage: "Performs photo metadata maintenance", Usage: "Updates estimates, titles, and descriptions",
Action: optimizeAction, Action: optimizeAction,
} }
// optimizeAction starts metadata check and optimization. // optimizeAction updates metadata such as titles and estimate.
func optimizeAction(ctx *cli.Context) error { func optimizeAction(ctx *cli.Context) error {
start := time.Now() start := time.Now()
@@ -35,7 +35,7 @@ func optimizeAction(ctx *cli.Context) error {
conf.InitDb() conf.InitDb()
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("optimize: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
worker := workers.NewMeta(conf) worker := workers.NewMeta(conf)

View File

@@ -17,11 +17,11 @@ import (
// PlacesCommand registers the places subcommands. // PlacesCommand registers the places subcommands.
var PlacesCommand = cli.Command{ var PlacesCommand = cli.Command{
Name: "places", Name: "places",
Usage: "Geolocation management subcommands", Usage: "Geodata management subcommands",
Subcommands: []cli.Command{ Subcommands: []cli.Command{
{ {
Name: "update", Name: "update",
Usage: "Updates the index with the latest geodata from our backend", Usage: "Updates your index with the latest location data",
Action: placesUpdateAction, Action: placesUpdateAction,
}, },
}, },

View File

@@ -62,7 +62,7 @@ func purgeAction(ctx *cli.Context) error {
} }
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("purge: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
w := service.Purge() w := service.Purge()

View File

@@ -18,7 +18,7 @@ import (
// ResetCommand resets the index and removes sidecar files after confirmation. // ResetCommand resets the index and removes sidecar files after confirmation.
var ResetCommand = cli.Command{ var ResetCommand = cli.Command{
Name: "reset", Name: "reset",
Usage: "Resets the index and removes JSON / YAML sidecar files", Usage: "Resets the index and removes generated sidecar files",
Action: resetAction, Action: resetAction,
} }
@@ -27,7 +27,7 @@ func resetAction(ctx *cli.Context) error {
log.Warnf("YOU ARE ABOUT TO RESET THE INDEX AND REMOVE ALL JSON / YAML SIDECAR FILES") log.Warnf("YOU ARE ABOUT TO RESET THE INDEX AND REMOVE ALL JSON / YAML SIDECAR FILES")
removeIndexPrompt := promptui.Prompt{ removeIndexPrompt := promptui.Prompt{
Label: "Reset index database incl all albums and metadata?", Label: "Reset index database including albums and metadata?",
IsConfirm: true, IsConfirm: true,
} }

View File

@@ -104,7 +104,7 @@ func startAction(ctx *cli.Context) error {
} }
if conf.ReadOnly() { if conf.ReadOnly() {
log.Infof("start: read-only mode enabled") log.Infof("config: read-only mode enabled")
} }
// start web server // start web server

View File

@@ -13,7 +13,7 @@ import (
// ThumbsCommand registers the resample cli command. // ThumbsCommand registers the resample cli command.
var ThumbsCommand = cli.Command{ var ThumbsCommand = cli.Command{
Name: "thumbs", Name: "thumbs",
Usage: "Regenerates thumbnails based on the current settings", Usage: "Generates thumbnails using the current settings",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "force, f", Name: "force, f",

View File

@@ -344,7 +344,7 @@ var GlobalFlags = []cli.Flag{
}, },
cli.StringFlag{ cli.StringFlag{
Name: "darktable-blacklist", Name: "darktable-blacklist",
Usage: "RAW file `EXTENSIONS` incompatible with Darktable", Usage: "file `EXTENSIONS` incompatible with Darktable",
Value: "cr3,dng", Value: "cr3,dng",
EnvVar: "PHOTOPRISM_DARKTABLE_BLACKLIST", EnvVar: "PHOTOPRISM_DARKTABLE_BLACKLIST",
}, },
@@ -356,7 +356,7 @@ var GlobalFlags = []cli.Flag{
}, },
cli.StringFlag{ cli.StringFlag{
Name: "rawtherapee-blacklist", Name: "rawtherapee-blacklist",
Usage: "RAW file `EXTENSIONS` incompatible with RawTherapee", Usage: "file `EXTENSIONS` incompatible with RawTherapee",
Value: "", Value: "",
EnvVar: "PHOTOPRISM_RAWTHERAPEE_BLACKLIST", EnvVar: "PHOTOPRISM_RAWTHERAPEE_BLACKLIST",
}, },