retroforth/tools/retro-document.sh
crc 139b322f79 retro-document: fix detection of sigils used
FossilOrigin-Name: 22babfb155716d1834a20d3356ee8f94dd73430386f0a6296209cc2da85fce91
2021-06-18 18:49:23 +00:00

19 lines
601 B
Bash
Executable file

#!/bin/sh
# This is a quick and dirty shell script to extract the words
# in a source file and return the descriptions of them.
#
# Requirements:
#
# In your $PATH:
#
# - retro
# - retro-describe
# - retro-unu
#
# Usage:
#
# ./describe sourcefile
retro-unu $1 | tr " " "\n" | sed '/^[[:space:]]*$/d' | grep -Ev "^[\\\^\.\"\@\!\$\`:&'#$.\(\|]" | sort | uniq | tr "\n" "\0" | xargs -0 retro-describe | cat -s
retro-unu $1 | tr " " "\n" | sed '/^[[:space:]]*$/d' | cut -c1-1 | sort | uniq | grep "[\\\^\.\"\@\!\$\`:&'#$.\(\|]" | sed 's/^/sigil:/' | tr "\n" "\0" | xargs -0 retro-describe | cat -s