diff options
Diffstat (limited to 'cmd/gotosocial/admin.go')
-rw-r--r-- | cmd/gotosocial/admin.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/cmd/gotosocial/admin.go b/cmd/gotosocial/admin.go index 810d57e54..3dad3e3d6 100644 --- a/cmd/gotosocial/admin.go +++ b/cmd/gotosocial/admin.go @@ -170,7 +170,7 @@ func adminCommands() *cobra.Command { adminMediaCmd := &cobra.Command{ Use: "media", - Short: "admin commands related stored media attachments/emojis", + Short: "admin commands related to stored media / emojis", } /* @@ -178,7 +178,7 @@ func adminCommands() *cobra.Command { */ adminMediaPruneCmd := &cobra.Command{ Use: "prune", - Short: "admin commands for pruning unused/orphaned media from storage", + Short: "admin commands for pruning media from storage", } adminMediaPruneOrphanedCmd := &cobra.Command{ @@ -196,7 +196,7 @@ func adminCommands() *cobra.Command { adminMediaPruneRemoteCmd := &cobra.Command{ Use: "remote", - Short: "prune unused/stale remote media from storage, older than given number of days", + Short: "prune unused / stale media from storage, older than given number of days", PreRunE: func(cmd *cobra.Command, args []string) error { return preRun(preRunArgs{cmd: cmd}) }, @@ -207,6 +207,19 @@ func adminCommands() *cobra.Command { config.AddAdminMediaPrune(adminMediaPruneRemoteCmd) adminMediaPruneCmd.AddCommand(adminMediaPruneRemoteCmd) + adminMediaPruneAllCmd := &cobra.Command{ + Use: "all", + Short: "perform all media and emoji prune / cleaning commands", + PreRunE: func(cmd *cobra.Command, args []string) error { + return preRun(preRunArgs{cmd: cmd}) + }, + RunE: func(cmd *cobra.Command, args []string) error { + return run(cmd.Context(), prune.All) + }, + } + config.AddAdminMediaPrune(adminMediaPruneAllCmd) + adminMediaPruneCmd.AddCommand(adminMediaPruneAllCmd) + adminMediaCmd.AddCommand(adminMediaPruneCmd) adminCmd.AddCommand(adminMediaCmd) |