diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-30 20:15:05 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-30 20:15:05 +0530 |
commit | a3a7b41179d8abe9edc705db6b14063e95c459fa (patch) | |
tree | 935506bc5ddf9c6a28b45b619b370178f1dc13d4 /cmd/search.go | |
parent | 599139984e50d769bb97332ed5a327cf6d41ba37 (diff) |
added --query option to episodes and chapters command
Diffstat (limited to 'cmd/search.go')
-rw-r--r-- | cmd/search.go | 8 |
1 files changed, 7 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>. 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) |