summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-10-16 00:59:51 +0200
committerAraq <rumpf_a@web.de>2017-10-16 00:59:51 +0200
commit604a15c0aaf6d3df28b3236b9aeb32acea7d653f (patch)
tree260ed26e50559f8d8167487e96addf257372377c /tools
parentc06f73b48456c194a2eb4692f0de63bea09449c4 (diff)
downloadNim-604a15c0aaf6d3df28b3236b9aeb32acea7d653f.tar.gz
some progress on the nimpretty tool; still not ready
Diffstat (limited to 'tools')
-rw-r--r--tools/nimpretty.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/nimpretty.nim b/tools/nimpretty.nim
index 2c967b1e8..36d1382cf 100644
--- a/tools/nimpretty.nim
+++ b/tools/nimpretty.nim
@@ -42,7 +42,8 @@ proc writeVersion() =
 proc prettyPrint(infile: string) =
   let fileIdx = fileInfoIdx(infile)
   let tree = parseFile(fileIdx, newIdentCache())
-  renderModule(tree, infile, {})
+  let outfile = changeFileExt(infile, ".pretty.nim")
+  renderModule(tree, infile, outfile, {})
 
 proc main =
   var infile: string
@@ -50,7 +51,7 @@ proc main =
   for kind, key, val in getopt():
     case kind
     of cmdArgument:
-      infile = key
+      infile = key.addFileExt(".nim")
     of cmdLongoption, cmdShortOption:
       case normalize(key)
       of "help", "h": writeHelp()