diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-10-31 15:05:17 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-10-31 15:05:17 -0700 |
| commit | 7a35e38d8778670fe0662f203e82638355db3bba (patch) | |
| tree | cc9f813d1350f23d2b81a81b18f4f127668bfec9 /tools/upgrade.nom | |
| parent | f43d8c58f755a7f208d84b43071490ab356c5ac8 (diff) | |
Renamed (action %) -> (%'s meaning)
Diffstat (limited to 'tools/upgrade.nom')
| -rwxr-xr-x | tools/upgrade.nom | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/upgrade.nom b/tools/upgrade.nom index 7d36793..575646e 100755 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -1,7 +1,7 @@ #!/usr/bin/env nomsu -V4.8.10 # Tool to automatically update code from old versions of Nomsu. Usage: - nomsu tools/upgrade.nom [-i] file1 file2 directory1 ... + nomsu tools/upgrade.nom [-i] file1 file2 directory1 ... If "-i" is the first argument, upgrades will be performed in-place. Otherwise, the upgraded code will be printed. @@ -10,27 +10,37 @@ use "lib/os.nom" %args = (command line args) %inplace = (no) +%start_version = (nil) %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 + + "-S": + %start_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 to %version) + %uptree = (..) + %tree upgraded from (%start_version or (%tree.version or (Nomsu version))) to %version %text = "\ ..#!/usr/bin/env nomsu -V\%version \(%uptree as nomsu)" |
