aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-07-03 22:56:00 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-07-03 22:56:00 +0530
commit6ac3bd9b1cc4b9c897e8e9623313924b80f6a4b2 (patch)
treebdf1d84e8d9e5a40c9c81180c40b626ff3606209
parentd57c3ba06e1e661b650a07fd3dc66b2e20dd8daa (diff)
added flags to modify prompt length and search results length
-rw-r--r--cmd/search.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/search.go b/cmd/search.go
index 969af8f..391919e 100644
--- a/cmd/search.go
+++ b/cmd/search.go
@@ -38,7 +38,7 @@ var searchCmd = &cobra.Command {
"\t\x1b[33m`macli search -m <manga-name>`\x1b[0m searches for a manga\n" +
"\t\x1b[33m`macli search`\x1b[0m interactively asks for an anime to search for (same for manga with -m/--manga flag)\n",
Run: func(cmd *cobra.Command, args []string) {
- mal.Init()
+ mal.Init()
// read searchInput from command
searchInput := strings.Join(args, " ")
mangaMode, err := cmd.Flags().GetBool("manga")
@@ -77,4 +77,9 @@ func searchAnime(searchInput string) {
func init() {
rootCmd.AddCommand(searchCmd)
+ searchCmd.PersistentFlags().IntVarP(&ui.PromptLength, "prompt-length", "l", 5, "Length of select prompt")
+ searchCmd.PersistentFlags().BoolVarP(&mangaMode, "manga", "m", false, "Use manga mode")
+ searchCmd.PersistentFlags().IntVarP(&mal.SearchLength, "search-length", "n", 10, "Amount of search results to load")
+ searchCmd.PersistentFlags().IntVarP(&mal.SearchOffset, "search-offset", "o", 0, "Offset for the search results")
+ searchCmd.PersistentFlags().BoolVarP(&queryOnlyMode, "query", "q", false, "Query only (don't update data)")
}