CLI: Revised descriptions of commands and configuration flags

This commit is contained in:
Michael Mayer
2021-10-07 13:00:32 +02:00
parent 874af1db61
commit 8a063037e0
5 changed files with 51 additions and 50 deletions

View File

@@ -10,6 +10,7 @@ import (
"path/filepath"
"time"
"github.com/dustin/go-humanize/english"
"github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/config"
@@ -22,7 +23,7 @@ import (
// BackupCommand configures the backup cli command.
var BackupCommand = cli.Command{
Name: "backup",
Usage: "Creates index database and album backups",
Usage: "Creates index database dumps and optional YAML album backups",
UsageText: `A custom index sql backup FILENAME may be passed as first argument. Use - for stdout. By default, the backup path is searched.`,
Flags: backupFlags,
Action: backupAction,
@@ -31,23 +32,23 @@ var BackupCommand = cli.Command{
var backupFlags = []cli.Flag{
cli.BoolFlag{
Name: "force, f",
Usage: "overwrite existing backup files",
Usage: "replace existing backup files",
},
cli.BoolFlag{
Name: "albums, a",
Usage: "create album yaml file backups",
Usage: "create album YAML backup files",
},
cli.StringFlag{
Name: "albums-path",
Usage: "custom album yaml file backup `PATH`",
Usage: "custom album backup `PATH`",
},
cli.BoolFlag{
Name: "index, i",
Usage: "create index sql database backup",
Usage: "create index database SQL dump",
},
cli.StringFlag{
Name: "index-path",
Usage: "custom index sql database backup `PATH`",
Usage: "custom index database backup `PATH`",
},
}
@@ -179,7 +180,7 @@ func backupAction(ctx *cli.Context) error {
if count, err := photoprism.BackupAlbums(albumsPath, true); err != nil {
return err
} else {
log.Infof("%d albums saved as yaml files", count)
log.Infof("created %s", english.Plural(count, "YAML album backup file", "YAML album backup files"))
}
}