summary refs log tree commit diff stats
path: root/nimpretty
diff options
context:
space:
mode:
Diffstat (limited to 'nimpretty')
-rw-r--r--nimpretty/nimpretty.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/nimpretty/nimpretty.nim b/nimpretty/nimpretty.nim
index 8e8c58597..e5abf0d2d 100644
--- a/nimpretty/nimpretty.nim
+++ b/nimpretty/nimpretty.nim
@@ -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()