aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-01-14 17:50:57 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-01-14 17:50:57 -0800
commit94a437c58426ce00976d3ab15f19817642d188c4 (patch)
treee57c255c4ee94ebf7d0369327f242bdb4101cd45
parent27433f4bf1c3ac80d47869d581d8d18b630921cf (diff)
Added 'with' to 'if it fails with $' clauses and made upgrade import
specific rules.
-rwxr-xr-xlib/tools/find.nom2
-rwxr-xr-xlib/tools/format.nom2
-rwxr-xr-xlib/tools/replace.nom2
-rwxr-xr-xlib/tools/upgrade.nom5
4 files changed, 8 insertions, 3 deletions
diff --git a/lib/tools/find.nom b/lib/tools/find.nom
index aa4bc7b..a4db987 100755
--- a/lib/tools/find.nom
+++ b/lib/tools/find.nom
@@ -63,7 +63,7 @@ command line program with $args:
$code = (NomsuCode from ($Source $filename 1 (size of $file)) $file)
try:
$tree = ($code parsed)
- ..if it fails $msg:
+ ..if it fails with $msg:
say
red ("
\$filename failed to parse:
diff --git a/lib/tools/format.nom b/lib/tools/format.nom
index e60d12e..445f35e 100755
--- a/lib/tools/format.nom
+++ b/lib/tools/format.nom
@@ -28,7 +28,7 @@ command line program with $args:
$code = (NomsuCode from ($Source $filename 1 (size of $file)) $file)
try:
$tree = ($code parsed)
- ..if it fails $msg:
+ ..if it fails with $msg:
if $args.q:
$formatted = $file
..else:
diff --git a/lib/tools/replace.nom b/lib/tools/replace.nom
index fdb8e38..efc4d09 100755
--- a/lib/tools/replace.nom
+++ b/lib/tools/replace.nom
@@ -93,7 +93,7 @@ command line program with $args:
$code = (NomsuCode from ($Source $filename 1 (size of $file)) $file)
try:
$tree = ($code parsed)
- ..if it fails $msg:
+ ..if it fails with $msg:
if $args.q:
unless $args.i: say $code
..else:
diff --git a/lib/tools/upgrade.nom b/lib/tools/upgrade.nom
index 1ef91b9..2c63411 100755
--- a/lib/tools/upgrade.nom
+++ b/lib/tools/upgrade.nom
@@ -15,6 +15,11 @@ use "commandline"
command line program with $args:
$inplace = ($args.i or $args.inplace)
$start_version = $args."upgrade-from"
+ if $start_version:
+ try:
+ use $start_version
+ ..if it fails:
+ fail "Could not find upgrade rules for \$start_version"
$version = ($args."upgrade-to" or (Nomsu version))
$test = ($args.t or $args.test)
for $filename in $args.extras: