aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/upgrade.nom15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/upgrade.nom b/tools/upgrade.nom
index e55d835..26b01bd 100644
--- a/tools/upgrade.nom
+++ b/tools/upgrade.nom
@@ -1,10 +1,21 @@
+#!/usr/bin/env Nomsu -V 2.2.4.3
use "core"
use "compatibility"
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:
+ if (%path is "-i"): %inplace <- (yes)
for file %filename in %path:
%tree <- (parse (read file %filename) from %filename)
%tree <- (%tree upgraded from %tree.version to (Nomsu version))
- say "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%tree as nomsu)"
+ %text <- "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%tree as nomsu)"
+ if %inplace:
+ write %text to file %filename
+ ..else:
+ say %text