Fix build of hyperlinked grep

This commit is contained in:
Kovid Goyal 2024-07-28 21:13:54 +05:30
parent a19ce66e62
commit 00737ebf30
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -427,6 +427,28 @@ func specialize_command(hg *cli.Command) {
hg.ArgCompleter = cli.CompletionForWrapper("rg")
}
type Options struct {
}
func create_cmd(root *cli.Command, run_func func(*cli.Command, *Options, []string) (int, error)) {
ans := root.AddSubCommand(&cli.Command{
Name: "hyperlinked_grep",
Run: func(cmd *cli.Command, args []string) (int, error) {
opts := Options{}
err := cmd.GetOptionValues(&opts)
if err != nil {
return 1, err
}
return run_func(cmd, &opts, args)
},
Hidden: true,
})
specialize_command(ans)
clone := root.AddClone(ans.Group, ans)
clone.Hidden = false
clone.Name = "hyperlinked-grep"
}
func EntryPoint(parent *cli.Command) {
create_cmd(parent, main)
}