aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autoformat.nom17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom
index 7126608..de25292 100755
--- a/tools/autoformat.nom
+++ b/tools/autoformat.nom
@@ -1,6 +1,17 @@
-#!/usr/bin/env nomsu -V2.3.4.3
+#!/usr/bin/env nomsu -V2.4.4.3
use "core"
use "lib/os.nom"
-for %path in (=lua "arg"):
+%args = (command line args)
+%inplace = (no)
+if (%args.1 is "-i"):
+ %inplace = (yes)
+ remove index 1 from %args
+
+for %path in %args:
for file %filename in %path:
- say ((parse (read file %filename) from %filename) as nomsu) \ No newline at end of file
+ %formatted = ".."
+ #!/usr/bin/env nomsu -V\(Nomsu version)
+ \((parse (read file %filename) from %filename) as nomsu)
+
+ if %inplace: write %formatted to file %filename
+ ..else: say %formatted \ No newline at end of file