From a3a7b41179d8abe9edc705db6b14063e95c459fa Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Thu, 30 Jun 2022 20:15:05 +0530 Subject: added --query option to episodes and chapters command --- cmd/search.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd/search.go') diff --git a/cmd/search.go b/cmd/search.go index 2e485e3..89ab17f 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -19,6 +19,8 @@ along with this program. If not, see . package cmd import ( + "os" + "fmt" "strings" "github.com/spf13/cobra" "github.com/MikunoNaka/macli/ui" @@ -36,7 +38,11 @@ var searchCmd = &cobra.Command { Run: func(cmd *cobra.Command, args []string) { // read searchInput from command searchInput := strings.Join(args, " ") - mangaMode, _ := cmd.Flags().GetBool("manga") + mangaMode, err := cmd.Flags().GetBool("manga") + if err != nil { + fmt.Println("Error while reading \x1b[33m--manga\x1b[0m flag.", err.Error()) + os.Exit(1) + } if mangaMode { searchManga(searchInput) -- cgit v1.2.3