
/**
 * Module dependencies.
 */

var shellwords = require('shellwords');

module.exports = function(cmd){
  var args = arguments;
  var len = args.length;
  var i = 1;

  cmd = cmd.replace(/\?/g, function(){
    return shellwords.escape(String(args[i++]));
  });

  while (i < len) {
    cmd += ' ' + shellwords.escape(String(args[i++]));
  }

  return cmd;
};