From d7ccb42582f85acf30568913610ccf4d602023fb Mon Sep 17 00:00:00 2001 From: Taco Hoekwater Date: Wed, 1 Jun 2011 08:54:21 +0000 Subject: commit context 2011.05.18 git-svn-id: svn://tug.org/texlive/trunk@22719 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/context/lua/mtx-grep.lua | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/scripts/context/lua/mtx-grep.lua') diff --git a/Master/texmf-dist/scripts/context/lua/mtx-grep.lua b/Master/texmf-dist/scripts/context/lua/mtx-grep.lua index 9604bc9f85d..963422c68ec 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-grep.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-grep.lua @@ -6,11 +6,25 @@ if not modules then modules = { } end modules ['mtx-babel'] = { license = "see context related readme files" } +local helpinfo = [[ +--pattern search for pattern (optional) +--count count matches only +--nocomment skip lines that start with %% or # + +patterns are lua patterns and need to be escaped accordingly +]] + +local application = logs.application { + name = "mtx-grep", + banner = "Simple Grepper 0.10", + helpinfo = helpinfo, +} + +local report = application.report + scripts = scripts or { } scripts.grep = scripts.grep or { } -logs.extendbanner("Simple Grepper 0.10",true) - local find, format = string.find, string.format local cr = lpeg.P("\r") @@ -94,14 +108,6 @@ function scripts.grep.find(pattern, files, offset) end end -messages.help = [[ ---pattern search for pattern (optional) ---count count matches only ---nocomment skip lines that start with %% or # - -patterns are lua patterns and need to be escaped accordingly -]] - local pattern = environment.argument("pattern") local files = environment.files and #environment.files > 0 and environment.files @@ -110,5 +116,5 @@ if pattern and files then elseif files then scripts.grep.find(files[1], files, 2) else - logs.help(messages.help) + application.help() end -- cgit v1.2.3