summary refs log tree commit diff stats
path: root/compiler/c2nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-07-30 10:43:05 +0200
committerAraq <rumpf_a@web.de>2011-07-30 10:43:05 +0200
commit086f0d34dbcd6e2333a8f25d313f2431ad5acaa3 (patch)
tree9665f3d0d79675db0c4287ec3aa78527e56deb65 /compiler/c2nim
parent6781da5215df16602a266c33c0834eae47ede04b (diff)
parente601673590e41517bd7e34e4fb2677d1618bff68 (diff)
downloadNim-086f0d34dbcd6e2333a8f25d313f2431ad5acaa3.tar.gz
Merge branch 'master' of git@github.com:Araq/Nimrod
Diffstat (limited to 'compiler/c2nim')
-rwxr-xr-xcompiler/c2nim/c2nim.nim16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/c2nim/c2nim.nim b/compiler/c2nim/c2nim.nim
index beb4465fc..6d7a0d6c1 100755
--- a/compiler/c2nim/c2nim.nim
+++ b/compiler/c2nim/c2nim.nim
@@ -7,7 +7,7 @@
 #    distribution, for details about the copyright.
 #
 
-import 
+import
   strutils, os, times, parseopt, llstream, ast, renderer, options, msgs,
   clex, cparse
 
@@ -17,16 +17,16 @@ const
 c2nim - C to Nimrod source converter
   (c) 2011 Andreas Rumpf
 Usage: c2nim [options] inputfile [options]
-Options: 
+Options:
   -o, --out:FILE         set output filename
   --dynlib:SYMBOL        import from dynlib: SYMBOL will be used for the import
   --header:HEADER_FILE   import from a HEADER_FILE (discouraged!)
-  --cdecl                annotate procs with ``{.cdecl.}`` 
+  --cdecl                annotate procs with ``{.cdecl.}``
   --stdcall              annotate procs with ``{.stdcall.}``
   --ref                  convert typ* to ref typ (default: ptr typ)
-  --prefix:PREFIX        strip prefix for the generated Nimrod identifiers 
+  --prefix:PREFIX        strip prefix for the generated Nimrod identifiers
                          (multiple --prefix options are supported)
-  --suffix:SUFFIX        strip suffix for the generated Nimrod identifiers 
+  --suffix:SUFFIX        strip suffix for the generated Nimrod identifiers
                          (multiple --suffix options are supported)
   --skipinclude          do not convert ``#include`` to ``import``
   --typeprefixes         generate ``T`` and ``P`` type prefixes
@@ -35,7 +35,7 @@ Options:
   -h, --help             show this help
 """
 
-proc main(infile, outfile: string, options: PParserOptions) = 
+proc main(infile, outfile: string, options: PParserOptions) =
   var start = getTime()
   var stream = LLStreamOpen(infile, fmRead)
   if stream == nil: rawMessage(errCannotOpenFile, infile)
@@ -61,10 +61,10 @@ for kind, key, val in getopt():
     of "version", "v":
       stdout.write(Version & "\n")
       quit(0)
-    of "o", "out": outfile = key
+    of "o", "out": outfile = val
     else:
       if not parserOptions.setOption(key, val):
-        stdout.write("[Error] unknown option: " & key)
+        stdout.writeln("[Error] unknown option: " & key)
   of cmdEnd: assert(false)
 if infile.len == 0:
   # no filename has been given, so we show the help: