@camoto/gamecomp
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -31,8 +31,9 @@ /* | ||
if (['-h', '--help', '-?', '?', undefined].some(v => param == v)) { | ||
console.log('gamecomp --formats | (+|-)format [opt=val [opt=val ...]]\n'); | ||
console.log('gamecomp --formats // List algorithms and their options'); | ||
console.log('gamecomp +example // Compress/encrypt with "example" algorithm'); | ||
console.log('gamecomp -example // Decompress/decrypt with "example"'); | ||
console.log('gamecomp +ex opt=123 // Pass parameter to algorithm'); | ||
console.log('gamecomp +ex @opt=file.dat // Pass file content as parameter'); | ||
console.log('gamecomp (--formats|--identify) | (+|-)format [opt=val [opt=val ...]]\n'); | ||
console.log('gamecomp --formats // List algorithms and their options'); | ||
console.log('gamecomp +xyz < in > out // Compress/encrypt with "xyz" algorithm'); | ||
console.log('gamecomp -xyz < in > out // Decompress/decrypt with "xyz"'); | ||
console.log('gamecomp +xyz opt=123 // Pass parameter to algorithm'); | ||
console.log('gamecomp +xyz @opt=file.dat // Pass file content as parameter'); | ||
console.log('gamecomp --identify < in // Identify format if possible'); | ||
console.log('DEBUG=\'gamecomp:*\' gamecomp ... // Troubleshoot'); | ||
@@ -53,2 +54,19 @@ process.exit(0); | ||
if (param == '--identify') { | ||
const content = fs.readFileSync(0, null); | ||
for (const handler of gamecompAll) { | ||
if (handler.identify) { | ||
const md = handler.metadata(); | ||
try { | ||
const result = handler.identify(content); | ||
console.log(`${md.id}: ${result.valid.toString()}; ${result.reason}`); | ||
} catch (e) { | ||
console.error(e); | ||
console.error(`BUG: ${md.id} threw exception: ${e.message}`); | ||
} | ||
} | ||
} | ||
process.exit(0); | ||
} | ||
let obscure; | ||
@@ -55,0 +73,0 @@ switch (param[0]) { |
@@ -24,2 +24,3 @@ /* | ||
export { default as cmp_lzw } from './cmp-lzw.js'; | ||
export { default as cmp_pklite } from './cmp-pklite.js'; | ||
export { default as cmp_rle_bash } from './cmp-rle-bash.js'; | ||
@@ -26,0 +27,0 @@ export { default as cmp_rle_ccomic } from './cmp-rle-ccomic.js'; |
{ | ||
"name": "@camoto/gamecomp", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "Apply and remove compression and encryption algorithms used by DOS games", | ||
@@ -5,0 +5,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118768
23
3277