From be01c45b86b13c80c113455340a97ce3e69a6117 Mon Sep 17 00:00:00 2001 From: Jan Mewes Date: Sat, 3 Jan 2026 09:13:42 +0100 Subject: [PATCH] feat: support multiple path for archive --- cmd/archive.go | 19 +++++++++++-------- cmd/search.go | 3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmd/archive.go b/cmd/archive.go index 5e731e3..dfb0650 100644 --- a/cmd/archive.go +++ b/cmd/archive.go @@ -10,16 +10,19 @@ import ( ) var archiveCmd = &cobra.Command{ - Use: "archive [flags] path", - Args: cobra.ExactArgs(1), + Use: "archive [flags] path [path...]", + Short: "Moves log entries into the archive directory", + Args: cobra.MinimumNArgs(1), + Aliases: []string{"a"}, Run: func(cmd *cobra.Command, args []string) { - path := args[0] - err := core.Archive(configuration, path) - if err != nil { - logging.Error("Archive failed", err) - os.Exit(1) + for _, path := range args { + err := core.Archive(configuration, path) + if err != nil { + logging.Error("Archive failed", err) + os.Exit(1) + } + fmt.Println(path) } - fmt.Println(path) }, } diff --git a/cmd/search.go b/cmd/search.go index 03271da..7873e69 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -10,7 +10,8 @@ import ( ) var searchCmd = &cobra.Command{ - Use: "search [flags] search_term", + Use: "search [flags] search_term", + Aliases: []string{"s"}, Run: func(cmd *cobra.Command, args []string) { searchTerm := ""