export PrettyOptions,prettyPrint from nimpretty (#15865)
This commit is contained in:
parent
7b19217798
commit
204435ad97
1 changed files with 6 additions and 5 deletions
|
|
@ -44,11 +44,11 @@ proc writeVersion() =
|
||||||
quit(0)
|
quit(0)
|
||||||
|
|
||||||
type
|
type
|
||||||
PrettyOptions = object
|
PrettyOptions* = object
|
||||||
indWidth: Natural
|
indWidth*: Natural
|
||||||
maxLineLen: Positive
|
maxLineLen*: Positive
|
||||||
|
|
||||||
proc prettyPrint(infile, outfile: string, opt: PrettyOptions) =
|
proc prettyPrint*(infile, outfile: string, opt: PrettyOptions) =
|
||||||
var conf = newConfigRef()
|
var conf = newConfigRef()
|
||||||
let fileIdx = fileInfoIdx(conf, AbsoluteFile infile)
|
let fileIdx = fileInfoIdx(conf, AbsoluteFile infile)
|
||||||
let f = splitFile(outfile.expandTilde)
|
let f = splitFile(outfile.expandTilde)
|
||||||
|
|
@ -119,4 +119,5 @@ proc main =
|
||||||
os.copyFile(source = infile, dest = infileBackup)
|
os.copyFile(source = infile, dest = infileBackup)
|
||||||
prettyPrint(infile, outfile, opt)
|
prettyPrint(infile, outfile, opt)
|
||||||
|
|
||||||
main()
|
when isMainModule:
|
||||||
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue