aboutsummaryrefslogtreecommitdiff
path: root/tools/upgrade.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-10-30 20:32:14 -0700
committerBruce Hill <bruce@bruce-hill.com>2018-10-30 20:32:49 -0700
commite7e84c9eda38c930f5475301de4a449dcf59e8b6 (patch)
treeb0d3890516170ca5aee0269aace10121b97a7593 /tools/upgrade.nom
parentfdf7a537c8ae13fc7ccb32278e5e364a52005443 (diff)
Fix for compiler not parenthesizing method targets, fix for parser not
recognizing \ line continuation, and improvements to upgrade tool API.
Diffstat (limited to 'tools/upgrade.nom')
-rwxr-xr-xtools/upgrade.nom27
1 files changed, 17 insertions, 10 deletions
diff --git a/tools/upgrade.nom b/tools/upgrade.nom
index cd3fbbb..4e03945 100755
--- a/tools/upgrade.nom
+++ b/tools/upgrade.nom
@@ -10,22 +10,29 @@ use "lib/os.nom"
%args = (command line args)
%inplace = (no)
-if (%args.1 is "-i"):
- %inplace = (yes)
- %args::remove index 1
-
-if (%args.1 is "-t"):
- use "lib/consolecolor.nom"
- %test = (yes)
- %args::remove index 1
+%version = (Nomsu version)
+repeat:
+ if %args.1 is:
+ "-i":
+ %inplace = (yes)
+ %args::remove index 1
+ "-t":
+ use "lib/consolecolor.nom"
+ %test = (yes)
+ %args::remove index 1
+ "-V":
+ %version = %args.2
+ %args::remove index 1
+ %args::remove index 1
+ else: stop
for %path in %args:
for file %filename in %path:
unless (%filename::matches "%.nom$"): do next %filename
%tree = (parse (read file %filename) from %filename)
- %uptree = (%tree upgraded)
+ %uptree = (%tree upgraded to %version)
%text = "\
- ..#!/usr/bin/env nomsu -V\(Nomsu version)
+ ..#!/usr/bin/env nomsu -V\%version
\(%uptree as nomsu)"
if: