mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
Add directory input support to nimpretty (#23590)
Feel free to close if this an unwanted addition :)
This commit is contained in:
@@ -116,7 +116,13 @@ proc main =
|
||||
for kind, key, val in getopt():
|
||||
case kind
|
||||
of cmdArgument:
|
||||
infiles.add(key.addFileExt(".nim"))
|
||||
if dirExists(key):
|
||||
for file in walkDirRec(key, skipSpecial = true):
|
||||
if file.endsWith(".nim") or file.endsWith(".nimble"):
|
||||
infiles.add(file)
|
||||
else:
|
||||
infiles.add(key.addFileExt(".nim"))
|
||||
|
||||
of cmdLongOption, cmdShortOption:
|
||||
case normalize(key)
|
||||
of "help", "h": writeHelp()
|
||||
|
||||
Reference in New Issue
Block a user