You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
Right now, commands are always of the form -A expr. I propose that we redesign them so that any number of arguments may be used.
For example, let's say that we want to add a command that lets us control how many occurences of a match we want to have. For example, -c '>= 2' expr. Then, -g expr would be short for -c '> 0' expr, and -v expr would be short for -c '== 0' expr.
If we are to allow any number of arguments, we should drop the notion of flags entirely, as they typically only allow 0 or 1 values. I still think a preceding character other than - would be useful to visualise the start of these chained commands.
I propose ., for example:
gogrep .x expr1 .c '>= 2' expr2
Suggestions of more commands that would use more information than an expression to match are welcome.
I'm not going to do this. Instead, gogrep will expose a nice API to write complex queries as Go code. In a way that would resemble writing a linter, but in a much simpler and higher-level way, while also having full access to custom logic via Go code.
Right now, commands are always of the form
-A expr
. I propose that we redesign them so that any number of arguments may be used.For example, let's say that we want to add a command that lets us control how many occurences of a match we want to have. For example,
-c '>= 2' expr
. Then,-g expr
would be short for-c '> 0' expr
, and-v expr
would be short for-c '== 0' expr
.If we are to allow any number of arguments, we should drop the notion of flags entirely, as they typically only allow 0 or 1 values. I still think a preceding character other than
-
would be useful to visualise the start of these chained commands.I propose
.
, for example:Suggestions of more commands that would use more information than an expression to match are welcome.
@rogpeppe thoughts?
The text was updated successfully, but these errors were encountered: