diff options
Diffstat (limited to 'tools/nimpretty.nim')
-rw-r--r-- | tools/nimpretty.nim | 5 |
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() |