packages/ls/dist/commands/ls.js
function formatAll(results, options, showName) {
    var stdout = '';
    if (showName) {
      for (var i = 0; i < results.length; ++i) {
        stdout += results[i].path + ':\n';
        if (options.l) {
          stdout += 'total ' + results[i].size + '\n';
        }
        stdout += results[i].results;
        if (i !== results.length - 1) {
          stdout += '\n\n';
        }
      }
    } else if (results.length === 1) {
      if (options.l && !options.x) {
        stdout += 'total ' + results[0].size + '\n';
      }
      stdout += results[0].results;
    }
    return stdout;
  }
function formatAll(results, options, showName) {
    var stdout = '';
    if (showName) {
      for (var i = 0; i < results.length; ++i) {
        stdout += results[i].path + ':\n';
        if (options.l) {
          stdout += 'total ' + results[i].size + '\n';
        }
        stdout += results[i].results;
        if (i !== results.length - 1) {
          stdout += '\n\n';
        }
      }
    } else if (results.length === 1) {
      if (options.l && !options.x) {
        stdout += 'total ' + results[0].size + '\n';
      }
      stdout += results[0].results;
    }
    return stdout;
  }
function formatAll ( results , options , showName ) { var stdout = '' ; if ( showName ) { for ( var i = 0 ; i < results . length ; ++ i ) { stdout += results [ i ] . path + ':\n' ; if ( options . l ) { stdout += 'total ' + results [ i ] . size + '\n' ; } stdout += results [ i ] . results ; if ( i !== results . length - 1 ) { stdout += '\n\n' ; } } } else if ( results . length === 1 ) { if ( options . l && ! options . x ) { stdout += 'total ' + results [ 0 ] . size + '\n' ; } stdout += results [ 0 ] . results ; } return stdout ; }
Concatenates the results of multiple
`execDir` functions into their proper
form based on options provided.

@param {Array} results
@param {Object} options
@param {boolean} showName
@return {String} stdout
@api private
Concatenates the results of multiple execDir functions into their proper form based on options provided .