Backend: Improve command help #187

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-01-22 10:35:00 +01:00
parent afa307a28f
commit 02f605e6a8
6 changed files with 13 additions and 12 deletions

View file

@ -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,
}

View file

@ -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,
}

View file

@ -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)

View file

@ -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,
}

View file

@ -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,
}

View file

@ -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,