#!/usr/bin/env node

/**
 * External dependencies
 */
"use strict";

var _debug = _interopRequireDefault(require("debug"));

var _command = _interopRequireDefault(require("../lib/cli/command"));

var _searchAndReplace = require("../lib/search-and-replace");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Internal dependencies
 */
const debug = (0, _debug.default)('vip:bin:vip-search-replace');
(0, _command.default)({
  requiredArgs: 1
}).example('vip search replace <file>  --pair=<from,to>', 'Replace instances of <from> with <to> in the SQL File').argv(process.argv, async arg => {
  debug('Args: ', arg);
  const filename = arg[0];

  if (!arg && !filename) {
    console.error('You must pass in a filename');
    process.exit(1);
  }

  const pairs = [];
  const isImport = false;
  (0, _searchAndReplace.searchAndReplace)(filename, pairs, isImport);
});