From b9a787c7140d2d679a2087b2253397c56efff426 Mon Sep 17 00:00:00 2001 From: crc Date: Wed, 8 Jan 2020 21:45:46 +0000 Subject: [PATCH] add retro-locate to search the tags file generated by retro-tags FossilOrigin-Name: f85240e729d909e1e9b244692f41568a77deae68e3ab6304fc456188389884ca --- Makefile | 2 ++ example/retro-locate.retro | 6 ++++++ example/retro-tags.retro | 2 ++ 3 files changed, 10 insertions(+) create mode 100755 example/retro-locate.retro diff --git a/Makefile b/Makefile index 09d0d19..62c0a6c 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,7 @@ install: build install-data install-docs install-examples install-manpages install -c -m 755 bin/retro-describe $(DESTDIR)$(PREFIX)/bin/retro-describe install -c -m 755 bin/retro-document $(DESTDIR)$(PREFIX)/bin/retro-document install -c -m 755 example/retro-tags.retro $(DESTDIR)$(PREFIX)/bin/retro-tags + install -c -m 755 example/retro-locate.retro $(DESTDIR)$(PREFIX)/bin/retro-locate install-strip: build install-data install-docs install-examples install -m 755 -d -- $(DESTDIR)/bin @@ -43,6 +44,7 @@ install-strip: build install-data install-docs install-examples install -c -m 755 bin/retro-describe $(DESTDIR)$(PREFIX)/bin/retro-describe install -c -m 755 bin/retro-document $(DESTDIR)$(PREFIX)/bin/retro-document install -c -m 755 example/retro-tags.retro $(DESTDIR)$(PREFIX)/bin/retro-tags + install -c -m 755 example/retro-locate.retro $(DESTDIR)$(PREFIX)/bin/retro-locate install-data: install -m 755 -d -- $(DESTDIR)$(DATADIR) diff --git a/example/retro-locate.retro b/example/retro-locate.retro new file mode 100755 index 0000000..2bc0ae7 --- /dev/null +++ b/example/retro-locate.retro @@ -0,0 +1,6 @@ +#!/usr/bin/env retro + +~~~ +'Line var +'tags [ &Heap [ ASCII:HT s:tokenize !Line @Line #0 a:fetch #0 sys:argv s:eq? [ @Line #2 a:fetch @Line #1 a:fetch s:put $: c:put s:put nl ] if ] v:preserve ] file:for-each-line +~~~ diff --git a/example/retro-tags.retro b/example/retro-tags.retro index a314dba..0a4a9e8 100755 --- a/example/retro-tags.retro +++ b/example/retro-tags.retro @@ -6,6 +6,8 @@ rm -f tags touch tags find . -name '*.retro' -print0 | xargs -0 -n 1 retro $0 >>tags find . -name '*.forth' -print0 | xargs -0 -n 1 retro $0 >>tags +cat tags | sort | uniq >tags2 +mv tags2 tags exit --------------------------------------------------------------