diff options
author | Araq <rumpf_a@web.de> | 2017-10-16 00:59:51 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-10-16 00:59:51 +0200 |
commit | 604a15c0aaf6d3df28b3236b9aeb32acea7d653f (patch) | |
tree | 260ed26e50559f8d8167487e96addf257372377c /tools | |
parent | c06f73b48456c194a2eb4692f0de63bea09449c4 (diff) | |
download | Nim-604a15c0aaf6d3df28b3236b9aeb32acea7d653f.tar.gz |
some progress on the nimpretty tool; still not ready
Diffstat (limited to 'tools')
-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() |