-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
search_code.go
30 lines (26 loc) · 1.38 KB
/
search_code.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var search_codeCmd = &cobra.Command{
Use: "code <query>",
Short: "Search within code",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(search_codeCmd).Standalone()
search_codeCmd.Flags().String("extension", "", "Filter on file extension")
search_codeCmd.Flags().String("filename", "", "Filter on filename")
search_codeCmd.Flags().StringP("jq", "q", "", "Filter JSON output using a jq `expression`")
search_codeCmd.Flags().StringSlice("json", []string{}, "Output JSON with the specified `fields`")
search_codeCmd.Flags().String("language", "", "Filter results by language")
search_codeCmd.Flags().StringP("limit", "L", "", "Maximum number of code results to fetch")
search_codeCmd.Flags().StringSlice("match", []string{}, "Restrict search to file contents or file path: {file|path}")
search_codeCmd.Flags().StringSlice("owner", []string{}, "Filter on owner")
search_codeCmd.Flags().StringSliceP("repo", "R", []string{}, "Filter on repository")
search_codeCmd.Flags().String("size", "", "Filter on size range, in kilobytes")
search_codeCmd.Flags().StringP("template", "t", "", "Format JSON output using a Go template; see \"gh help formatting\"")
search_codeCmd.Flags().BoolP("web", "w", false, "Open the search query in the web browser")
searchCmd.AddCommand(search_codeCmd)
}