From 02f605e6a887987d93437958dff3c6cf2f630e55 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 22 Jan 2020 10:35:00 +0100 Subject: [PATCH] Backend: Improve command help #187 Signed-off-by: Michael Mayer --- internal/commands/convert.go | 2 +- internal/commands/import.go | 2 +- internal/commands/index.go | 13 +++++++------ internal/commands/migrate.go | 2 +- internal/commands/stop.go | 2 +- internal/commands/thumbnails.go | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/commands/convert.go b/internal/commands/convert.go index 3c2b2c645..5ce28e490 100644 --- a/internal/commands/convert.go +++ b/internal/commands/convert.go @@ -11,7 +11,7 @@ import ( // Converts RAW files to JPEG images, if no JPEG already exists var ConvertCommand = cli.Command{ Name: "convert", - Usage: "Converts RAW originals to JPEG", + Usage: "Converts originals in other formats to JPEG", Action: convertAction, } diff --git a/internal/commands/import.go b/internal/commands/import.go index a6be06bfd..39e46e8d1 100644 --- a/internal/commands/import.go +++ b/internal/commands/import.go @@ -14,7 +14,7 @@ import ( // Imports photos from path defined in command-line args var ImportCommand = cli.Command{ Name: "import", - Usage: "Imports photos", + Usage: "Add and index photos from import directory", Action: importAction, } diff --git a/internal/commands/index.go b/internal/commands/index.go index 72fff8268..db83ffde4 100644 --- a/internal/commands/index.go +++ b/internal/commands/index.go @@ -14,7 +14,7 @@ import ( // indexes all photos in originals directory (photo library) var IndexCommand = cli.Command{ Name: "index", - Usage: "indexes all originals", + Usage: "Indexes originals", Flags: indexFlags, Action: indexAction, } @@ -22,7 +22,7 @@ var IndexCommand = cli.Command{ var indexFlags = []cli.Flag{ cli.BoolFlag{ Name: "all, a", - Usage: "re-index all originals, including unchanged ones", + Usage: "re-index all originals, including unchanged files", }, } @@ -50,16 +50,17 @@ func indexAction(ctx *cli.Context) error { tf := classify.New(conf.ResourcesPath(), conf.TensorFlowDisabled()) nd := nsfw.New(conf.NSFWModelPath()) - ind := photoprism.NewIndex(conf, tf, nd) - var files map[string]bool + var opt photoprism.IndexOptions + if ctx.Bool("all") { - files = ind.Start(photoprism.IndexOptionsAll()) + opt = photoprism.IndexOptionsAll() } else { - files = ind.Start(photoprism.IndexOptionsNone()) + opt = photoprism.IndexOptionsNone() } + files := ind.Start(opt) elapsed := time.Since(start) log.Infof("indexed %d files in %s", len(files), elapsed) diff --git a/internal/commands/migrate.go b/internal/commands/migrate.go index 586069bbe..387cbf7fb 100644 --- a/internal/commands/migrate.go +++ b/internal/commands/migrate.go @@ -11,7 +11,7 @@ import ( // Automatically migrates / initializes database var MigrateCommand = cli.Command{ Name: "migrate", - Usage: "Automatically migrates / initializes database", + Usage: "Automatically initializes and migrates the database", Action: migrateAction, } diff --git a/internal/commands/stop.go b/internal/commands/stop.go index 1f2045445..f92edcdab 100644 --- a/internal/commands/stop.go +++ b/internal/commands/stop.go @@ -11,7 +11,7 @@ import ( // StopCommand stops the daemon if running. var StopCommand = cli.Command{ Name: "stop", - Usage: "Stops daemon", + Usage: "Stops web server in daemon mode", Action: stopAction, } diff --git a/internal/commands/thumbnails.go b/internal/commands/thumbnails.go index d7630e421..e01760c91 100644 --- a/internal/commands/thumbnails.go +++ b/internal/commands/thumbnails.go @@ -11,11 +11,11 @@ import ( // Pre-renders thumbnails var ThumbnailsCommand = cli.Command{ Name: "thumbnails", - Usage: "Render thumbnails for all originals", + Usage: "Pre-render thumbnails to boost performance", Flags: []cli.Flag{ cli.BoolFlag{ Name: "force, f", - Usage: "Re-create existing thumbnails", + Usage: "re-create existing thumbnails", }, }, Action: thumbnailsAction,