Auth: Refactor existing CLI sub-commands #808 #3943

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-02 17:06:57 +01:00
parent e8939ca8d0
commit 910e3becbb
9 changed files with 23 additions and 24 deletions

View File

@@ -18,10 +18,10 @@ const (
ClientEnable = "re-enable client authentication"
)
// ClientsCommand configures the client application subcommands.
var ClientsCommand = cli.Command{
// ClientsCommands configures the client application subcommands.
var ClientsCommands = cli.Command{
Name: "clients",
Usage: "API authentication subcommands",
Usage: "Client credentials subcommands",
Subcommands: []cli.Command{
ClientsListCommand,
ClientsAddCommand,

View File

@@ -14,7 +14,7 @@ import (
// ClientsRemoveCommand configures the command name, flags, and action.
var ClientsRemoveCommand = cli.Command{
Name: "rm",
Usage: "Deletes a registered client application",
Usage: "Deletes the specified client application",
ArgsUsage: "[id]",
Flags: []cli.Flag{
cli.BoolFlag{

View File

@@ -48,8 +48,8 @@ var PhotoPrism = []cli.Command{
FindCommand,
ImportCommand,
CopyCommand,
FacesCommand,
PlacesCommand,
FacesCommands,
PlacesCommands,
PurgeCommand,
CleanUpCommand,
OptimizeCommand,
@@ -57,14 +57,14 @@ var PhotoPrism = []cli.Command{
ConvertCommand,
ThumbsCommand,
MigrateCommand,
MigrationsCommand,
MigrationsCommands,
BackupCommand,
RestoreCommand,
ResetCommand,
PasswdCommand,
UsersCommand,
ClientsCommand,
ShowCommand,
UsersCommands,
ClientsCommands,
ShowCommands,
VersionCommand,
ShowConfigCommand,
ConnectCommand,

View File

@@ -18,8 +18,8 @@ import (
"github.com/photoprism/photoprism/pkg/fs"
)
// FacesCommand configures the command name, flags, and action.
var FacesCommand = cli.Command{
// FacesCommands configures the command name, flags, and action.
var FacesCommands = cli.Command{
Name: "faces",
Usage: "Face recognition subcommands",
Subcommands: []cli.Command{

View File

@@ -43,8 +43,8 @@ var MigrationsRunCommand = cli.Command{
Action: migrationsRunAction,
}
// MigrationsCommand registers the "migrations" CLI command.
var MigrationsCommand = cli.Command{
// MigrationsCommands registers the "migrations" CLI command.
var MigrationsCommands = cli.Command{
Name: "migrations",
Usage: "Database schema migration subcommands",
Subcommands: []cli.Command{

View File

@@ -21,7 +21,7 @@ import (
// PasswdCommand configures the command name, flags, and action.
var PasswdCommand = cli.Command{
Name: "passwd",
Usage: "Changes the password of the user specified as argument",
Usage: "Changes the password of a registered user",
ArgsUsage: "[username]",
Flags: []cli.Flag{
cli.BoolFlag{

View File

@@ -13,8 +13,8 @@ import (
"github.com/photoprism/photoprism/internal/query"
)
// PlacesCommand configures the command name, flags, and action.
var PlacesCommand = cli.Command{
// PlacesCommands configures the command name, flags, and action.
var PlacesCommands = cli.Command{
Name: "places",
Usage: "Maps and location details subcommands",
Subcommands: []cli.Command{

View File

@@ -4,8 +4,8 @@ import (
"github.com/urfave/cli"
)
// ShowCommand configures the show subcommands.
var ShowCommand = cli.Command{
// ShowCommands configures the show subcommands.
var ShowCommands = cli.Command{
Name: "show",
Usage: "Shows supported formats, features, and config options",
Subcommands: []cli.Command{

View File

@@ -17,11 +17,10 @@ const (
UserWebDAVUsage = "allow to sync files via WebDAV"
)
// UsersCommand configures the user management subcommands.
var UsersCommand = cli.Command{
Name: "users",
Aliases: []string{"user"},
Usage: "User management subcommands",
// UsersCommands configures the user management subcommands.
var UsersCommands = cli.Command{
Name: "users",
Usage: "User management subcommands",
Subcommands: []cli.Command{
UsersListCommand,
UsersLegacyCommand,