mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
export PrettyOptions,prettyPrint from nimpretty (#15865)
(cherry picked from commit 204435ad97)
This commit is contained in:
@@ -44,11 +44,11 @@ proc writeVersion() =
|
||||
quit(0)
|
||||
|
||||
type
|
||||
PrettyOptions = object
|
||||
indWidth: Natural
|
||||
maxLineLen: Positive
|
||||
PrettyOptions* = object
|
||||
indWidth*: Natural
|
||||
maxLineLen*: Positive
|
||||
|
||||
proc prettyPrint(infile, outfile: string, opt: PrettyOptions) =
|
||||
proc prettyPrint*(infile, outfile: string, opt: PrettyOptions) =
|
||||
var conf = newConfigRef()
|
||||
let fileIdx = fileInfoIdx(conf, AbsoluteFile infile)
|
||||
let f = splitFile(outfile.expandTilde)
|
||||
@@ -119,4 +119,5 @@ proc main =
|
||||
os.copyFile(source = infile, dest = infileBackup)
|
||||
prettyPrint(infile, outfile, opt)
|
||||
|
||||
main()
|
||||
when isMainModule:
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user