diff --git a/tools/find/find.pgen2 b/tools/find/find.pgen2 index 2b5dcfa4fa..5c5145563d 100644 --- a/tools/find/find.pgen2 +++ b/tools/find/find.pgen2 @@ -44,12 +44,31 @@ factor: ( | '-xtype' STRING | '-perm' STRING +| '-group' STRING +| '-user' STRING +| '-gid' STRING +| '-uid' STRING +| '-nogroup' +| '-nouser' STRING + | '-empty' | '-executable' | '-readable' | '-writable' # for time (TODO) +| '-amin' STRING +| '-anewer' STRING +| '-atime' STRING + +| '-cmin' STRING +| '-cnewer' STRING +| '-ctime' STRING + +| '-mmin' STRING +| '-newer' STRING # note -newer not -mnewer +| '-mtime' STRING +| '-newerXY' STRING # Actions | '-delete' @@ -59,15 +78,19 @@ factor: ( | '-print' | '-print0' | '-printf' STRING +| '-ls' | '-fprint' STRING | '-fprint0' STRING | '-fprintf' STRING STRING +| '-fls' STRING # TODO: can the command be empty? # parse {}? That is replaced with the current filename. | '-exec' STRING* terminator | '-execdir' STRING* terminator +| '-ok' STRING* terminator +| '-okdir' STRING* terminator ) terminator: ';' | '+' diff --git a/tools/find/parse.py b/tools/find/parse.py index 88277a0744..dae3890288 100755 --- a/tools/find/parse.py +++ b/tools/find/parse.py @@ -49,15 +49,25 @@ def Tokens(strs): '-path', '-ipath', '-size', '-type', '-xtype', '-perm', + + '-group', '-user', + '-gid', '-uid', + '-nogroup', '-nouser', + '-empty', '-executable', '-readable', '-writable', + '-amin', '-anewer', '-atime', + '-cmin', '-cnewer', '-ctime', + '-mmin', '-newer', '-mtime', # note -newer not -mnewer + '-newerXY', + '-delete', '-prune', '-quit', - '-print', '-print0', '-printf', - '-fprint', '-fprint0', '-fprintf', + '-print', '-print0', '-printf', '-ls', + '-fprint', '-fprint0', '-fprintf', '-fls', - '-exec', '-execdir', + '-exec', '-execdir', '-ok', '-okdir', ] OPMAP = {}