Restore: Improve command flags and usage docs #1190 #1193

This commit is contained in:
Michael Mayer
2021-04-20 08:40:39 +02:00
parent de5a71f1a2
commit 55d502bbca
4 changed files with 59 additions and 28 deletions

View File

@@ -27,7 +27,7 @@ import (
var BackupCommand = cli.Command{
Name: "backup",
Usage: "Creates album and index backups",
UsageText: `A custom index sql backup FILENAME may be passed as first argument. Use - for stdout.`,
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,
}
@@ -60,7 +60,6 @@ func backupAction(ctx *cli.Context) error {
// Use command argument as backup file name.
indexFileName := ctx.Args().First()
indexPath := ctx.String("index-path")
backupIndex := ctx.Bool("index") || indexFileName != "" || indexPath != ""
albumsPath := ctx.String("albums-path")
@@ -179,6 +178,8 @@ func backupAction(ctx *cli.Context) error {
albumsPath = conf.AlbumsPath()
}
log.Infof("backing up albums to %s", txt.Quote(albumsPath))
if count, err := photoprism.BackupAlbums(albumsPath, true); err != nil {
return err
} else {