<commit_before>#!/usr/bin/env node

// don't assume that npm is installed in any particular spot, since this
// might conceivably be a bootstrap attempt.
var fs = require("fs")
  , path = require("path")
  , sys = require("sys")
  , path = require("path")
  , npm = require("./npm")

  // supported commands.
  , log = require("./lib/utils/log")
  , argv = process.argv.slice(2)
  , arg = ""

  , conf = {}
  , key
  , arglist = []
  , command
  , flagsDone

log(sys.inspect(argv), "cli")

while (arg = argv.shift()) {
  if (!command && (arg in npm.commands)) {
    if (key) {
      conf[key] = true
      key = null
    }
    command = arg
  } else if (!flagsDone && arg.substr(0, 2) === "--") {
    if (key) conf[key] = true
    key = arg.substr(2)
    flagsDone = (key === "")
  } else if (key) {
    conf[key] = arg
    key = null
  } else arglist.push(arg)
}
if (key) conf[key] = true
npm.argv = arglist
for (var k in conf) npm.config.set(k, conf[k])

if (!command) {
  // npm.commands.help([arglist.join(" ")])
  sys.error( "Usage:\n"
           + "  npm [flags] <command> [args]\n"
           + "Check 'man npm' or 'man npm-help' for more information"
           )
} else npm.commands[command](arglist, function (er, ok) {
  if (er) {
    sys.error("")
    log(er, "!")
    sys.error("")
    log("try running: 'npm help "+command+"'", "failure")
    log("Report this *entire* log at <http://github.com/isaacs/npm/issues>", "failure")
    log("or email it to <<EMAIL>>", "failure")
  } else log("ok")
})<commit_msg>show the unrecognized command if one was provided<commit_after>#!/usr/bin/env node

// don't assume that npm is installed in any particular spot, since this
// might conceivably be a bootstrap attempt.
var fs = require("fs")
  , path = require("path")
  , sys = require("sys")
  , path = require("path")
  , npm = require("./npm")

  // supported commands.
  , log = require("./lib/utils/log")
  , argv = process.argv.slice(2)
  , arg = ""

  , conf = {}
  , key
  , arglist = []
  , command
  , flagsDone

log(sys.inspect(argv), "cli")

while (arg = argv.shift()) {
  if (!command && (arg in npm.commands)) {
    if (key) {
      conf[key] = true
      key = null
    }
    command = arg
  } else if (!flagsDone && arg.substr(0, 2) === "--") {
    if (key) conf[key] = true
    key = arg.substr(2)
    flagsDone = (key === "")
  } else if (key) {
    conf[key] = arg
    key = null
  } else arglist.push(arg)
}
if (key) conf[key] = true
npm.argv = arglist
for (var k in conf) npm.config.set(k, conf[k])

if (!command) {
  // npm.commands.help([arglist.join(" ")])
  if (arglist.length) log(arglist, "unknown command")
  sys.error( "Usage:\n"
           + "  npm [flags] <command> [args]\n"
           + "Check 'man npm' or 'man npm-help' for more information"
           )
} else npm.commands[command](arglist, function (er, ok) {
  if (er) {
    sys.error("")
    log(er, "!")
    sys.error("")
    log("try running: 'npm help "+command+"'", "failure")
    log("Report this *entire* log at <http://github.com/isaacs/npm/issues>", "failure")
    log("or email it to <<EMAIL>>", "failure")
  } else log("ok")
})
{'fraction_non_alphanumeric': 0.19284802043422733, 'fraction_numerical': 0.002554278416347382, 'mean_word_length': 2.7476076555023923, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6654319', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1108, 'n_words': 302}