From 65ed578259121f17a365b97956d19d67e0be8f60 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Sat, 20 Aug 2016 14:47:44 +0200 Subject: 2016-08-20 13:44:00 --- .../documents/general/manuals/math-mkiv.pdf | Bin 2722067 -> 2769223 bytes doc/context/scripts/mkiv/mtx-grep.html | 12 +++++++++++- doc/context/scripts/mkiv/mtx-grep.man | 9 +++++++++ doc/context/scripts/mkiv/mtx-grep.xml | 16 ++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/context/documents/general/manuals/math-mkiv.pdf b/doc/context/documents/general/manuals/math-mkiv.pdf index 916766a0a..5b6a5441e 100644 Binary files a/doc/context/documents/general/manuals/math-mkiv.pdf and b/doc/context/documents/general/manuals/math-mkiv.pdf differ diff --git a/doc/context/scripts/mkiv/mtx-grep.html b/doc/context/scripts/mkiv/mtx-grep.html index 45a32f987..3ba8e8547 100644 --- a/doc/context/scripts/mkiv/mtx-grep.html +++ b/doc/context/scripts/mkiv/mtx-grep.html @@ -42,10 +42,20 @@ --patternsearch for pattern (optional) --countcount matches only --nocommentskip lines that start with %% or # + --nshow at most n matches + --firstonly show first match + --matchreturn the match (if it is one) --xmlpattern is lpath expression
- +

Examples

+mtxrun --script grep --pattern=module *.mkiv +
mtxrun --script grep --pattern="modules.-%['(.-)'%]" char-*.lua --first +
mtxrun --script grep --pattern=module --count *.mkiv +
mtxrun --script grep --pattern=module --first *.mkiv +
mtxrun --script grep --pattern=module --nocomment *.mkiv +
mtxrun --script grep --pattern=module --n=10 *.mkiv +

diff --git a/doc/context/scripts/mkiv/mtx-grep.man b/doc/context/scripts/mkiv/mtx-grep.man index 2a3d30316..02c4db2f9 100644 --- a/doc/context/scripts/mkiv/mtx-grep.man +++ b/doc/context/scripts/mkiv/mtx-grep.man @@ -20,6 +20,15 @@ count matches only .B --nocomment skip lines that start with %% or # .TP +.B --n +show at most n matches +.TP +.B --first +only show first match +.TP +.B --match +return the match (if it is one) +.TP .B --xml pattern is lpath expression .SH AUTHOR diff --git a/doc/context/scripts/mkiv/mtx-grep.xml b/doc/context/scripts/mkiv/mtx-grep.xml index d8567e035..a78565b57 100644 --- a/doc/context/scripts/mkiv/mtx-grep.xml +++ b/doc/context/scripts/mkiv/mtx-grep.xml @@ -11,10 +11,26 @@ search for pattern (optional) count matches only skip lines that start with %% or # + show at most n matches + only show first match + return the match (if it is one) pattern is lpath expression + + + Examples + + mtxrun --script grep --pattern=module *.mkiv + mtxrun --script grep --pattern="modules.-%['(.-)'%]" char-*.lua --first + mtxrun --script grep --pattern=module --count *.mkiv + mtxrun --script grep --pattern=module --first *.mkiv + mtxrun --script grep --pattern=module --nocomment *.mkiv + mtxrun --script grep --pattern=module --n=10 *.mkiv + + + patterns are lua patterns and need to be escaped accordingly -- cgit v1.2.3