Re: Having grep support the -o option
- From
Jayati Shrivastava <gaurijove@gmail.com>
- Date
- Mar 20, 2022, 19:14 UTC
- Message-ID
- <CANsrJQdqoz7mZ9Fj08owgVWGKs25nPzE1g1dLASL=fz9j485hw@mail.gmail.com>
- In-Reply-To
- <220319.86a6dlewyj.gmgdl@evledraar.gmail.com>
On Sat, Mar 19, 2022 at 9:49 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 14 quoted lines
> > > One thing I'd *really* like to see is the bits of %(if) %(then) > etc. extracted from ref-filter.c into some general API other commands > could use with strbuf_expand() and friends. > > I.e. if you could in addition to the strbuf_expand() callback define > what verbs you support for "if" and the like, or have callbacks for > their comparison functions. > > Then have that machinery drive the whole format expansion, which > eventually would expand your %(some-custom-thing) via a callback. > > I.e. the whole "valid_atom" state machine in ref-filter.c.
So, the end goal is to design a formatting API that can be used by any command that takes --format option? Previous interns worked on unifying pretty.c and cat-file.c with ref-filter.c and so the next task can be to extend "valid_atom" state machine to work with more commands. Do you have any suggestions for new atoms/verbs I could add support for or any such similar small exercise to start with? +Hariom verma +Christian Couder +Git List