jade/generate-keywords.sh

18 lines
501 B
Bash
Raw Normal View History

2013-11-07 01:08:19 +00:00
#!/bin/sh
# KEYWORDS
KEYWORDS=$(ack '#define (\w+.|\w+)' cppbas.inc --output='$1')
KEYWORDS+=$(ack '^FUNCTION \w+ (\w+.|\w+)' cppbasrt.inc --output='$1')
KEYWORDS+='\n'$(ack '^SUB (\w+)' cppbasrt.inc --output='$1')
# FUNCTION/SUB PROTOTYPES
PROTO=$(ack '^FUNCTION \w+ (.+\))' cppbasrt.inc --output='$1')' '
PROTO+='\n'$(ack '^SUB (.+\))' cppbasrt.inc --output='$1')
#
# SAVE SORTED KEYWORDS/PROTOTYPES
echo "$KEYWORDS" | sort > Keywords.txt
echo "$PROTO" | sort > Prototypes.txt
echo "Done."