{"version":3,"file":"extract-command-for-type.mjs","names":["names","Actions.createDecodeActionWithMatcher"],"sources":["../../src/commands/extract-command-for-type.ts"],"sourcesContent":["import type { Command } from 'commander';\n\nimport type { ResourceType } from '@4bitlabs/sci0';\nimport { cmdIntParser } from './cmd-int-parser.js';\nimport * as Actions from '../actions/index.js';\nimport { createMatcherForType } from '../helpers/resource-matchers.js';\nimport { resourceTypeName as names } from './resource-type-name.js';\n\nexport const extractCommandForType = (type: ResourceType) => {\n  const matchById = createMatcherForType(type);\n  const NAME = names[type];\n  return function extractCommand(cmd: Command): Command {\n    cmd\n      .command('extract')\n      .description(\n        `extract binary data from resource files for ${NAME} by number`,\n      )\n      .argument('<num>', `${NAME} resource number`, cmdIntParser)\n      .option('-r, --raw', 'disable decompression and preamble', false)\n      .action(Actions.createDecodeActionWithMatcher(matchById));\n\n    return cmd;\n  };\n};\n"],"mappings":";;;;;;AAQA,MAAa,yBAAyB,SAAuB;CAC3D,MAAM,YAAY,qBAAqB,IAAI;CAC3C,MAAM,OAAOA,iBAAM;CACnB,OAAO,SAAS,eAAe,KAAuB;EACpD,IACG,QAAQ,SAAS,CAAC,CAClB,YACC,+CAA+C,KAAK,WACtD,CAAC,CACA,SAAS,SAAS,GAAG,KAAK,mBAAmB,YAAY,CAAC,CAC1D,OAAO,aAAa,sCAAsC,KAAK,CAAC,CAChE,OAAOC,8BAAsC,SAAS,CAAC;EAE1D,OAAO;CACT;AACF"}