<commit_before>var path = require('path')

JsGit.Cli = function(args, commandRunner) {
  var that           = this
  
  that.args          = args || []
  that.repoDir       = process.cwd()
  that.commandRunner = commandRunner || new JsGit.CommandRunner()
  that.argsWithoutOptions = []
  
  that.args.forEach(function(arg) {
    if (!/^-/.exec(arg)) that.argsWithoutOptions.push(arg)
    
    var result = /^--git-dir=(.*)$/.exec(arg)
    if (result) {
      if (result[1][0] == "/") { 
        that.repoDir = result[1] 
      } else {
        that.repoDir = path.join(process.cwd(), result[1])
      }
    }
  })
  that.commandName = that.argsWithoutOptions[0]
  
  that.repo = function() {
    new JsGit.Repo(that.repoDir)
  }
  
  that.run = function() {
    if (that.commandName == "show") {
      that.commandRunner.show(that.repo, that.argsWithoutOptions.slice(1), {}, function(output) {
        console.log(output)
      })
    } else if (that.commandName == "log") {
      that.commandRunner.log(that.repo)
    }
    
    // var repo = new JsGit.Repo()
    // repo.getLooseObject("0d9c45117cd2f34ca93a1e31a7fc69f50d54b34b", function(obj) {
    //   console.log(obj)
    // })
  }
}<commit_msg>Output a helpful message if a non-command is used.<commit_after>var path = require('path')

JsGit.Cli = function(args, commandRunner) {
  var that           = this
  
  that.args          = args || []
  that.repoDir       = process.cwd()
  that.commandRunner = commandRunner || new JsGit.CommandRunner()
  that.argsWithoutOptions = []
  
  that.args.forEach(function(arg) {
    if (!/^-/.exec(arg)) that.argsWithoutOptions.push(arg)
    
    var result = /^--git-dir=(.*)$/.exec(arg)
    if (result) {
      if (result[1][0] == "/") { 
        that.repoDir = result[1] 
      } else {
        that.repoDir = path.join(process.cwd(), result[1])
      }
    }
  })
  that.commandName = that.argsWithoutOptions[0]
  
  that.repo = function() {
    new JsGit.Repo(that.repoDir)
  }
  
  that.run = function() {
    if (that.commandName == "show") {
      that.commandRunner.show(that.repo, that.argsWithoutOptions.slice(1), {}, function(output) {
        console.log(output)
      })
    } else if (that.commandName == "log") {
      that.commandRunner.log(that.repo)
    } else {
      console.log("git.js: '" + that.commandName + "' is not a supported git command. See 'git.js --help'.")
    }
    
    // var repo = new JsGit.Repo()
    // repo.getLooseObject("0d9c45117cd2f34ca93a1e31a7fc69f50d54b34b", function(obj) {
    //   console.log(obj)
    // })
  }
}
{'fraction_non_alphanumeric': 0.16595080046856697, 'fraction_numerical': 0.02342834830144475, 'mean_word_length': 2.438926174496644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6491119', 'n_tokens_mistral': 938, 'n_tokens_neox': 904, 'n_words': 144}