aboutsummaryrefslogtreecommitdiff
path: root/src/main.cff
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cff')
-rw-r--r--src/main.cff17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main.cff b/src/main.cff
index 32aedb2..8d96bbb 100644
--- a/src/main.cff
+++ b/src/main.cff
@@ -6,11 +6,11 @@ fn prihelp(f *FILE, progname *const u8) void {
fprintf(f, "Compile cffc source code in FILE\n"
"\n"
"Options:\n"
- " --help, -h:\t\tshow this help message\n"
- " --target triple:\tset compilation target triple\n"
- " -:\t\t\tread input from stdin\n"
- " -o -:\t\tset output to stdout\n"
- " -o path:\t\tset output file path\n");
+ " --help, -h \t\tshow this help message\n"
+ " --target triple \tset compilation target triple\n"
+ " - \t\t\tread input from stdin\n"
+ " -p \t\t\toutput LLVM IR to stdout\n"
+ " -o path \t\toutput LLVM IR to file path\n");
}
extern fn main(argc int, argv **u8) int {
@@ -38,10 +38,13 @@ extern fn main(argc int, argv **u8) int {
case streq(arg, "--target");
triple = nextarg();
-
+
+ case streq(arg, "-p");
+ outfile = stdout;
+
case streq(arg, "-o");
let outpath = nextarg();
- outfile = streq(outpath, "-") ? stdout : fopen(outpath, "wb");
+ outfile = fopen(outpath, "wb");
if outfile == #null {
fprintf(stderr, "%s: error: cannot open '%s': %s\n", argv[0], outpath, strerror(errno));
return 1;