diff --git a/bin/loopy b/bin/loopy index 8f365c7be8a3fecaa7dbfdb4bea33246378f0342..c8cbea1c615c396d3903df24472822cc918d3461 100644 --- a/bin/loopy +++ b/bin/loopy @@ -50,8 +50,9 @@ def main(): parser = ArgumentParser(description="Stand-alone loopy frontend") - parser.add_argument("infile") - parser.add_argument("outfile") + parser.add_argument("infile", metavar="INPUT_FILE") + parser.add_argument("outfile", default="-", metavar="OUTPUT_FILE", + help="Defaults to stdout ('-').", nargs='?') parser.add_argument("--lang", metavar="LANGUAGE", help="loopy|fortran") parser.add_argument("--target") parser.add_argument("--name") @@ -185,10 +186,15 @@ def main(): code, impl_arg_info = generate_code(kernel) codes.append(code) - if args.outfile == "-": + if args.outfile: + outfile, = args.outfile + else: + outfile = "-" + + if outfile == "-": sys.stdout.write("\n\n".join(codes)) else: - with open(args.outfile, "w") as outfile_fd: + with open(outfile, "w") as outfile_fd: outfile_fd.write("\n\n".join(codes)) diff --git a/examples/fortran/run-floopy.sh b/examples/fortran/run-floopy.sh deleted file mode 100755 index fcea2c8b5ed58eed8738ad263df62cdf687b3d0f..0000000000000000000000000000000000000000 --- a/examples/fortran/run-floopy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh - -NAME="$1" -shift - -python $(which loopy) --lang=fpp "$NAME" - "$@" diff --git a/examples/fortran/run-loopy.sh b/examples/fortran/run-loopy.sh deleted file mode 100755 index f22f78424bc654e352fff2806120701d096d7068..0000000000000000000000000000000000000000 --- a/examples/fortran/run-loopy.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -python $(which loopy) --lang=loopy "$NAME" - "$@"