diff --git a/mes.c b/mes.c index e3a4075a..90915ed9 100644 --- a/mes.c +++ b/mes.c @@ -1543,6 +1543,8 @@ read_file (scm *e, scm *a) int main (int argc, char *argv[]) { + if (argc > 1 && !strcmp (argv[1], "--help")) return puts ("Usage: mes < FILE\n"); + if (argc > 1 && !strcmp (argv[1], "--version")) return puts ("Mes 0.0\n"); scm *a = mes_environment (); #if STATIC_PRIMITIVES mes_primitives (); diff --git a/scripts/elf.mes b/scripts/elf.mes index 1abf5975..ee3f043a 100755 --- a/scripts/elf.mes +++ b/scripts/elf.mes @@ -1,6 +1,6 @@ #! /bin/sh # -*-scheme-*- -cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes > a.out +cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes "$@" > a.out chmod +x a.out exit $? !# diff --git a/scripts/include.mes b/scripts/include.mes index 473f50b6..c13e2e35 100755 --- a/scripts/include.mes +++ b/scripts/include.mes @@ -1,5 +1,9 @@ #! /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; diff --git a/scripts/mescc.mes b/scripts/mescc.mes index 254348f0..dd21d5d0 100755 --- a/scripts/mescc.mes +++ b/scripts/mescc.mes @@ -1,6 +1,6 @@ #! /bin/sh # -*-scheme-*- -cat ${1-$(dirname $(dirname $0))/share/doc/mes/examples/main.c} | cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes > a.out +cat ${1-$(dirname $(dirname $0))/share/doc/mes/examples/main.c} | cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes "$@" > a.out chmod +x a.out exit $? !# diff --git a/scripts/paren.mes b/scripts/paren.mes index 79510ae1..4e430a82 100755 --- a/scripts/paren.mes +++ b/scripts/paren.mes @@ -1,6 +1,6 @@ #! /bin/sh # -*-scheme-*- -echo -e 'EOF\n___P((()))' | cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes +echo -e 'EOF\n___P((()))' | cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes "$@" chmod +x a.out exit $? !# diff --git a/scripts/repl.mes b/scripts/repl.mes index 6e6d893e..f1bdd670 100755 --- a/scripts/repl.mes +++ b/scripts/repl.mes @@ -1,6 +1,6 @@ #! /bin/sh # -*-scheme-*- -cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes +cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes "$@" exit $? !#