« get me outta code hell

upd8: accept and pass --magick-threads through properly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/upd8.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-28 14:46:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-01 16:00:52 -0300
commit75a7b56d3616d384b31757c9537a6e27f4e9b350 (patch)
treeb55bd29dd02ba3613437e687187d7e92024aad52 /src/upd8.js
parent2d1eaf5ea4c46527406df527f1b4d2fc36d8566e (diff)
upd8: accept and pass --magick-threads through properly
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-xsrc/upd8.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 2f08204..2ec231c 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -233,6 +233,12 @@ async function main() {
 
     'magick-threads': {
       help: `Process more or fewer thumbnail files at once with ImageMagick when generating thumbnails. (Each ImageMagick thread may also make use of multi-core processing at its own utility.)`,
+      type: 'value',
+      validate(threads) {
+        if (parseInt(threads) !== parseFloat(threads)) return 'an integer';
+        if (parseInt(threads) < 0) return 'a counting number or zero';
+        return true;
+      }
     },
     magick: {alias: 'magick-threads'},