retroforth/tools/retro-document.sh
crc 33118ff158 retro-describe: remove use of -J from xargs as it is not supported by GNU
FossilOrigin-Name: b7c7e29a709ec6621782b64302f3e8a92f806bf9f8f73b69e8d2bdf54ef8c0d0
2020-10-15 18:44:14 +00:00

19 lines
602 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/^/prefix:/' | tr "\n" "\0" | xargs -0 retro-describe | cat -s