var path = require( 'path' )
  , textract = require( './index' );

module.exports = function( filePath, flags ) {
  filePath = path.resolve( process.cwd(), filePath );

  for (var flag in flags) {
    if (flags[flag] !== undefined) {
      flags[flag] = ( flags[flag] === "true" );
    }
  }

  if ( flags.preserveLineBreaks === undefined ) {
    flags.preserveLineBreaks = true;
  }

  textract.fromFileWithPath( filePath, flags, function( error, text ) {
    if ( error ) {
      console.error( error );
    } else {
      console.log( text );
    }
  });
};

var path = require( 'path' )
  , textract = require( './index' );

module.exports = function( filePath, flags ) {
  filePath = path.resolve( process.cwd(), filePath );

  if ( flags.preserveLineBreaks === undefined ) {
    flags.preserveLineBreaks = true;
  }

  textract.fromFileWithPath( filePath, flags, function( error, text ) {
    if ( error ) {
      console.error( error );
    } else {
      console.log( text );
    }
  });
};

Fix all CLI options other than boolean true being converted to false
Fix all CLI options other than boolean true being converted to false

The changes made in https://github.com/dbashford/textract/pull/39
clobber any option passed at the command line. In light of
https://github.com/dbashford/textract/pull/54 this code is unnecessary
anyway.
