CLI: Improve help for cp, mv, thumbs, status, and optimize commands

This commit is contained in:
Michael Mayer
2021-10-05 23:13:06 +02:00
parent a5c2794611
commit 28268369b5
7 changed files with 20 additions and 19 deletions

View File

@@ -55,6 +55,7 @@ func main() {
app.Commands = []cli.Command{
commands.StartCommand,
commands.StopCommand,
commands.StatusCommand,
commands.IndexCommand,
commands.ImportCommand,
commands.CopyCommand,
@@ -63,9 +64,9 @@ func main() {
commands.PasswdCommand,
commands.PurgeCommand,
commands.CleanUpCommand,
commands.OptimizeCommand,
commands.ConvertCommand,
commands.ThumbsCommand,
commands.OptimizeCommand,
commands.MomentsCommand,
commands.MigrateCommand,
commands.BackupCommand,
@@ -73,7 +74,6 @@ func main() {
commands.ResetCommand,
commands.ConfigCommand,
commands.VersionCommand,
commands.StatusCommand,
}
if err := app.Run(os.Args); err != nil {

View File

@@ -16,8 +16,8 @@ import (
// ConvertCommand registers the convert cli command.
var ConvertCommand = cli.Command{
Name: "convert",
Usage: "Converts media files to JPEG and AVC as needed",
UsageText: `To limit scope, a PATH may be passed as first argument.`,
Usage: "Converts media files in other formats to JPEG / AVC",
ArgsUsage: "[path]",
Action: convertAction,
}

View File

@@ -19,6 +19,7 @@ var CopyCommand = cli.Command{
Name: "cp",
Aliases: []string{"copy"},
Usage: "Copies media files to originals",
ArgsUsage: "[path]",
Action: copyAction,
}

View File

@@ -19,6 +19,7 @@ var ImportCommand = cli.Command{
Name: "mv",
Aliases: []string{"import"},
Usage: "Moves media files to originals",
ArgsUsage: "[path]",
Action: importAction,
}

View File

@@ -14,7 +14,7 @@ import (
// OptimizeCommand registers the index cli command.
var OptimizeCommand = cli.Command{
Name: "optimize",
Usage: "Verifies and optimizes metadata",
Usage: "Performs index metadata maintenance",
Action: optimizeAction,
}

View File

@@ -12,14 +12,14 @@ import (
"github.com/photoprism/photoprism/internal/config"
)
// StatusCommand performs a server health check.
// StatusCommand registers the status command.
var StatusCommand = cli.Command{
Name: "status",
Usage: "Performs a server health check",
Usage: "Checks if the web server is running",
Action: statusAction,
}
// statusAction shows the server health status
// statusAction checks if the web server is running.
func statusAction(ctx *cli.Context) error {
conf := config.NewConfig(ctx)
client := &http.Client{Timeout: 10 * time.Second}

View File

@@ -13,8 +13,7 @@ import (
// ThumbsCommand registers the resample cli command.
var ThumbsCommand = cli.Command{
Name: "thumbs",
Aliases: []string{"resample"},
Usage: "Pre-renders thumbnail images",
Usage: "Pre-renders thumbnail images based on config options",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force, f",