mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
CLI: Revised descriptions of commands and configuration flags
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user