From 604a15c0aaf6d3df28b3236b9aeb32acea7d653f Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 16 Oct 2017 00:59:51 +0200 Subject: some progress on the nimpretty tool; still not ready --- tools/nimpretty.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools') 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() -- cgit 1.4.1-2-gfad0