aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autoformat.nom6
-rwxr-xr-xtools/upgrade.nom14
2 files changed, 14 insertions, 6 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom
index de25292..acabefb 100755
--- a/tools/autoformat.nom
+++ b/tools/autoformat.nom
@@ -1,6 +1,7 @@
-#!/usr/bin/env nomsu -V2.4.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
use "core"
use "lib/os.nom"
+
%args = (command line args)
%inplace = (no)
if (%args.1 is "-i"):
@@ -13,5 +14,6 @@ for %path in %args:
#!/usr/bin/env nomsu -V\(Nomsu version)
\((parse (read file %filename) from %filename) as nomsu)
- if %inplace: write %formatted to file %filename
+ if %inplace:
+ write %formatted to file %filename
..else: say %formatted \ No newline at end of file
diff --git a/tools/upgrade.nom b/tools/upgrade.nom
index 016e5b9..a505aaa 100755
--- a/tools/upgrade.nom
+++ b/tools/upgrade.nom
@@ -1,3 +1,4 @@
+#!/usr/bin/env nomsu -V2.5.4.3
#!/usr/bin/env Nomsu -V2.4.4.3
use "core"
use "compatibility"
@@ -8,25 +9,30 @@ use "lib/os.nom"
if (%args.1 is "-i"):
%inplace = (yes)
remove index 1 from %args
+
if (%args.1 is "-t"):
use "lib/consolecolor.nom"
%test = (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)
%uptree = (%tree upgraded)
- %text = "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%uptree as nomsu)"
+ %text = ".."
+ #!/usr/bin/env nomsu -V\(Nomsu version)
+ \(%uptree as nomsu)
+
if:
%inplace:
say "Upgraded \%filename"
write %text to file %filename
+
%test:
if (%uptree == %tree):
say (dim "\%filename will not be changed")
..else:
say (bright "\%filename will be changed")
- else:
- say %text
-
+
+ else: say %text \ No newline at end of file