From e7e84c9eda38c930f5475301de4a449dcf59e8b6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 30 Oct 2018 20:32:14 -0700 Subject: Fix for compiler not parenthesizing method targets, fix for parser not recognizing \ line continuation, and improvements to upgrade tool API. --- tools/upgrade.nom | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'tools') 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: -- cgit v1.2.3