ac4b1eed3f
* mes.c (main): Handle --help, --version. * scripts/include.mes: Handle --help. * scripts/elf.mes: Pass any arguments on to mes. * scripts/mescc.mes: Likewise. * scripts/paren.mes: Likewise. * scripts/repl.mes: Likewise.
16 lines
390 B
Bash
Executable file
16 lines
390 B
Bash
Executable file
#! /bin/sh
|
|
|
|
if [ "$1" == "--help" ]; then
|
|
echo "Usage: include.mes FILE"
|
|
exit 0
|
|
fi
|
|
for prefix in $(dirname $(dirname $0))/share/mes . $(dirname $(dirname $0)); do
|
|
if [ -d ${prefix}/module ]; then
|
|
break;
|
|
fi
|
|
done
|
|
cat $1 \
|
|
| grep -Eo '(mes-use-module \([^()]+ [^()]+))' \
|
|
| grep -Eo ' \([^)]+\)' \
|
|
| sed -e "s@^ *(@${prefix}/module/@" -e 's@ @/@g' -e 's@)@.mes@'
|