Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
/* eslint-env node */
/* vim: set ts=2 ft=javascript: */
const n = "cfb";
import * as X from 'cfb';
import fs = require('fs');
import program = require('commander');
import PRINTJ = require("printj");
const sprintf = PRINTJ.sprintf;
program
.version(X.version)
.usage('[options] [subfiles...]')
.option('-q, --quiet', 'process but do not report')
.option('-l, --list-files', 'list files')
.option('-z, --dump', 'dump internal representation but do not extract')
.option('-r, --repair', 'attempt to repair and garbage-collect archive')
.option('-c, --create', 'create file')
.option('-a, --append', 'add files to CFB (overwrite existing data)')
.option('-d, --delete', 'delete files from CFB')
.option('--dev', 'development mode')
.option('--read', 'read but do not print out contents');
program.parse(process.argv);
const exit = process.exit;
const die = (errno: number, msg: string) => { console.error(n + ": " + msg); exit(errno); };
const logit = (cmd: string, f: string) => { console.error(sprintf("%-6s %s", cmd, f)); };