[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"es2015\"]\n}"
  },
  {
    "path": ".eslintignore",
    "content": "src/lib/sugar.js"
  },
  {
    "path": ".gitignore",
    "content": "*.log\r\n\r\n# Runtime data\r\npids\r\n*.pid\r\n*.seed\r\n\r\n*sublime*\r\n\r\n# Directory for instrumented libs generated by jscoverage/JSCover\r\nlib-cov\r\n\r\n# Coverage directory used by tools like istanbul\r\ncoverage\r\n\r\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\r\n.grunt\r\n\r\n# node-waf configuration\r\n.lock-wscript\r\n\r\n# Compiled binary addons (http://nodejs.org/api/addons.html)\r\nbuild/Release\r\n\r\n# Dependency directory\r\n# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git\r\nnode_modules\r\n\r\n.cmd_history\r\n.cmd_history/*\r\n.cmd_history/cmd_historycash\r\n"
  },
  {
    "path": ".istanbul.yml",
    "content": "verbose: false\r\ninstrumentation:\r\n    root: .\r\n    extensions:\r\n        - .js\r\n    default-excludes: true\r\n    excludes: ['./dist/lib/sugar.js']\r\n    embed-source: false\r\n    variable: __coverage__\r\n    compact: true\r\n    preserve-comments: false\r\n    complete-copy: false\r\n    save-baseline: false\r\n    baseline-file: ./coverage/coverage-baseline.json\r\n    include-all-sources: false\r\n    include-pid: false\r\n    es-modules: false\r\nreporting:\r\n    print: summary\r\n    reports:\r\n        - lcov\r\n    dir: ./coverage\r\n    watermarks:\r\n        statements: [50, 80]\r\n        lines: [50, 80]\r\n        functions: [50, 80]\r\n        branches: [50, 80]\r\n    report-config:\r\n        clover: {file: clover.xml}\r\n        cobertura: {file: cobertura-coverage.xml}\r\n        json: {file: coverage-final.json}\r\n        json-summary: {file: coverage-summary.json}\r\n        lcovonly: {file: lcov.info}\r\n        teamcity: {file: null, blockName: Code Coverage Summary}\r\n        text: {file: null, maxCols: 0}\r\n        text-lcov: {file: lcov.info}\r\n        text-summary: {file: null}\r\nhooks:\r\n    hook-run-in-context: false\r\n    post-require-hook: null\r\n    handle-sigint: false\r\ncheck:\r\n    global:\r\n        statements: 0\r\n        lines: 0\r\n        branches: 0\r\n        functions: 0\r\n        excludes: []\r\n    each:\r\n        statements: 0\r\n        lines: 0\r\n        branches: 0\r\n        functions: 0\r\n        excludes: []\r\n\r\n"
  },
  {
    "path": ".travis.yml",
    "content": "sudo: false\r\nlanguage: node_js\r\nnode_js:\r\n  - \"7\"\r\n  - \"6\"\r\n  - \"5\"\r\n  - \"4\"\r\n  - \"8\"\r\nafter_success: \"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\"\r\nbranches:\r\n  only:\r\n    - master\r\n"
  },
  {
    "path": "LICENSE",
    "content": "(The MIT License)\r\n\r\nCopyright (c) 2015 DC <threedeecee@gmail.com>\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n'Software'), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "README.md",
    "content": "<h1 align=\"center\">\n\t<img width=\"284\" src=\"http://i.imgur.com/tKrIdAI.jpg\" alt=\"Cash\">\n\t<!--<img width=\"256\" src=\"http://i.imgur.com/oIN1WsM.jpg\" alt=\"Cash\">-->\n</h1>\n\n\n> Cross-platform Linux commands in pure ES6\n\n[![Build Status](https://travis-ci.org/dthree/cash.svg)](https://travis-ci.org/dthree/cash/)\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/286om4y0wbxs69fy?svg=true)](https://ci.appveyor.com/project/dthree/cash)\n[![Coverage Status](https://coveralls.io/repos/dthree/cash/badge.svg?branch=master&service=github)](https://coveralls.io/github/dthree/cash?branch=master)\n[![Gitter](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg)](https://gitter.im/dthree/cash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\nCash is a cross-platform implementation of Unix shell commands written in straight ES6. No native compiling and no external dependencies.\n\nWhile young, Cash aims to offer an alternative Linux feel on Windows and to open the door to cross-platform bash scripting in a Javascript environment.\n\n```bash\n> npm install cash -g\n> cash\n$\n```\n\n<p align=\"center\">\n  <img src=\"http://i.giphy.com/xT0BKNwUPFhFj2glry.gif\" alt=\"Cash\" />\n</p>\n\n\n### Woah.\n\nYeah. But it gets better. \n\nLet's mix some Windows & Unix commands together:\n\n```bash\n$ ipconfig | grep IPv4 | sort\nIPv4 Address. . . . . . . . . . . : 10.10.40.50\nIPv4 Address. . . . . . . . . . . : 192.168.100.11\n$\n```\n\n[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Interactive)\n\n\n### But I don't want to type \"cash\"\n\nNo problem. Let's make all commands global on your system:\n\n```bash\n> npm install cash-global -g\n> ls -lah\n```\n\n[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Global)\n\n\n### Nice, but I only want certain commands\n\nYou're covered!\n\n```bash\n> npm install cash-ls -g\n> npm install cash-grep -g\n```\n\n[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Global#installing-individual-commands)\n\n\n### Wow. But I want this programmatically!\n\nAgain, you're in business:\n\n```js\nconst $ = require('cash');\nconst out = $.ls('.', {l: true});\n```\n\nNot terse enough? How about this:\n\n```js\nconst out = $('ls -lah');\n```\n\nNot :sunglasses: enough? Try this:\n\n```js\nrequire('cash') `\n  cp -R ./src ./dest\n  ls | grep *-spec.js | cat\n  rm ./specResults.html \n`;\n```\n\n*For even better programmatic Unix commands, check out [ShellJS](https://github.com/shelljs/shelljs).*\n\n[Learn more](https://github.com/dthree/cash/wiki/Usage-|-Programmatic)\n\n\n### Isn't this impossible to do in Node?\n\nIt was, before [Vorpal](https://github.com/dthree/vorpal).\n\nMade with ❤ by [dthree](https://github.com/dthree).\n\nLove it? Give it a :star: or a tweet to help spread the word!\n\n\n## Notice\n\nThis is now an [OPEN Open Source](http://openopensource.org/) project. I am not able to invest a significant amount of time into maintaining Cash and so am looking for volunteers who would like to be active maintainers of the project. If you are interested, shoot me a note.\n\n## Contents\n\n- [Introduction](#introduction)\n- [Supported commands](#supported-commands)\n- [Configuration (.cashrc)](#configuration)\n- [Contributing](#contributing)\n- [FAQ](#faq)\n- [Team](#team)\n- [License](#license)\n- [Wiki](https://github.com/dthree/cash/wiki)\n\n## Introduction\n\nCash is a project working on a cross-platform implementation of the most used Unix-based commands in pure JavaScript and with no external dependencies.\n\nThe goal of Cash is to open up these commands to the massive JavaScript community for the first time, and to provide a cleaner, simpler and flexible alternative to applications like Cygwin for those wanting the Linux feel on Windows.\n\nCash was built with strict attention to nearly exact implementations and excellent test coverage of over 200 unit tests.\n\n\n## Supported commands\n\nThe following commands are currently implemented:\n\n- alias\n- cat\n- clear\n- cd\n- cp\n- echo\n- export\n- false\n- grep\n- head\n- kill\n- less\n- ls\n- mkdir\n- mv\n- pwd\n- rm\n- sort\n- source\n- tail\n- touch\n- true\n- unalias\n\nWant more commands?\n\n- [Vote on the next commands](https://github.com/dthree/cash/wiki/Roadmap)\n- [Help spread the word:](http://bit.ly/1LBEJ5s) More knowledge of Cash equals more contributors\n- [Contribute](#contributing)\n\n\n## Configuration\n\nWant to configure things to your heart's content? Just add your configurations in a `.cashrc` file (`_cashrc` also works, for Windows folk) and put that in your home directory. This supports anything you can do inside a cash command prompt (`export`ing environmental variables, aliases, etc.).\n\n## Contributing\n\n- [Editing commands](https://github.com/dthree/cash/wiki/Contributing#editing-existing-commands)\n- [Adding new commands](https://github.com/dthree/cash/wiki/Contributing)\n\nWe are currently looking for Core Team members who can push forward Cash at a rapid rate. Are you an awesome developer up to the challenge? Send me a ping.\n\n### Awesome contributors\n\n- [@nfischer](https://github.com/nfischer): Added `source`, `export`, `true` and `false` commands, among several other contributions.\n- [@safinn](https://github.com/safinn): Added `clear` and `tail` commands.\n- [@legien](https://github.com/legien): Added `head` command.\n- [@cspotcode](https://github.com/cspotcode): Implemented template literal execution.\n\n## FAQ\n\n\n#### Why Cash?\n\nIn its very essence, Cash replaces the Windows CLI prompt (`>`) with the Unix one (`$`), the dollar symbol. \n\nCash was most fitting in this sense: \n\n> Ask and ye shall receive\n\n```\n> cash\n$\n````\n\nCash is also a play on the word `bash`, and is actually[\\[1\\]](https://xkcd.com/906) a recursive acronym for Cash Shell.\n\nShout out to [@aseemk](https://github.com/aseemk) for donating the name.\n\n\n#### Doesn't ShellJS do this?\n\nNo.\n \nFor those who don't know, [ShellJS](https://github.com/shelljs/shelljs) is an awesome Node package that implements UNIX shell commands programatically in JavaScript. Check it out - really. While ShellJS was tremendously helpful in figuring out how to accomplish Cash, the two do not really conflict.\n\nShellJS gives the feel of UNIX commands in a code environment, but aims to implement the commands in a way that makes sense for a JavaScript library. This means that many commands return JavaScript objects, and some of the rougher and more dangerous edges of bash have been softened a bit.\n\nFor example, with cash:\n```javascript\n$('ls'); // 'node_modules\\n'\n\n$('echo foo > foo.txt');\n```\n\nWith ShellJS:\n```javascript\nls(); // ['node_modules'];\n\necho('foo').to('foo.txt');\n```\n\n\n## Team\n\n| [![David Caccavella](https://avatars.githubusercontent.com/u/10319897?s=130)](https://github.com/dthree) | [![Nate Fischer](https://avatars.githubusercontent.com/u/5801521?s=130)](https://github.com/nfischer) |\n|:---:|:---:|\n| [David Caccavella](https://github.com/dthree) | [Nate Fischer](https://github.com/nfischer) |\n\nWant to join the team? [Let us know](mailto:threedeecee@gmail.com).\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "appveyor.yml",
    "content": "environment:\n  matrix:\n    - nodejs_version: '7'\n    - nodejs_version: '6'\n    - nodejs_version: '5'\n    - nodejs_version: '4'\n    - nodejs_version: '8'\ninstall:\n  - ps: Install-Product node $env:nodejs_version\n  - set CI=true\n  - set CASH_APPVEYOR=true\n  - npm install -g npm@latest || (timeout 30 && npm install -g npm@latest)\n  - set PATH=%APPDATA%\\npm;%PATH%\n  - npm install || (timeout 30 && npm install)\nmatrix:\n  fast_finish: true\nbuild: off\nversion: '{build}'\nshallow_clone: true\nclone_depth: 1\ntest_script:\n  - node --version\n  - npm --version\n  - npm run test-win || (timeout 30 && npm run test-win)\n"
  },
  {
    "path": "bin/alias.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'alias');\n"
  },
  {
    "path": "bin/cash.js",
    "content": "#!/usr/bin/env node\n'use strict';\nvar cash = require('../dist/index');\nvar delimiter = require('./../dist/delimiter')\ndelimiter.refresh(cash.vorpal, function () {\n  cash.show();\n});\n"
  },
  {
    "path": "bin/cat.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'cat');\n"
  },
  {
    "path": "bin/cd.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'cd');\n"
  },
  {
    "path": "bin/clear.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'clear');\n"
  },
  {
    "path": "bin/cp.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'cp');\n"
  },
  {
    "path": "bin/echo.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'echo');\n"
  },
  {
    "path": "bin/export.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'export');\n"
  },
  {
    "path": "bin/false.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'false');\n"
  },
  {
    "path": "bin/grep.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'grep');\n"
  },
  {
    "path": "bin/head.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'head');\n"
  },
  {
    "path": "bin/kill.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'kill');\n"
  },
  {
    "path": "bin/less.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'less');\n"
  },
  {
    "path": "bin/ls.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'ls');\n"
  },
  {
    "path": "bin/mkdir.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'mkdir');\n"
  },
  {
    "path": "bin/mv.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'mv');\n"
  },
  {
    "path": "bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "bin/pwd.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'pwd');\n"
  },
  {
    "path": "bin/rm.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'rm');\n"
  },
  {
    "path": "bin/sort.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'sort');\n"
  },
  {
    "path": "bin/source.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'source');\n"
  },
  {
    "path": "bin/tail.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'tail');\n"
  },
  {
    "path": "bin/touch.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'touch');\n"
  },
  {
    "path": "bin/true.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'true');\n"
  },
  {
    "path": "bin/unalias.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'unalias');\n"
  },
  {
    "path": "bin/which.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'which');\n"
  },
  {
    "path": "commands.json",
    "content": "{\n  \"commands\": [\n    \"alias\",\n    \"cat\",\n    \"cd\",\n    \"clear\",\n    \"cp\",\n    \"echo\",\n    \"head\",\n    \"export\",\n    \"false\",\n    \"kill\",\n    \"ls\",\n    \"mkdir\",\n    \"mv\",\n    \"pwd\",\n    \"sort\",\n    \"source\",\n    \"tail\",\n    \"touch\",\n    \"true\",\n    \"less\",\n    \"grep\",\n    \"rm\",\n    \"unalias\",\n    \"which\"\n    ],\n  \"globalExclusions\": [\n    \"alias\",\n    \"cd\",\n    \"echo\",\n    \"export\",\n    \"less\",\n    \"sort\",\n    \"source\",\n    \"unalias\"\n  ],\n  \"importedCommands\": [\n    \"less\",\n    \"grep\"\n  ],\n  \"windowsExclusions\": [\n    \"time\"\n  ],\n  \"dependencies\": {\n    \"./dist/delimiter.js\": [\"username\", \"./dist/util/converter.path.js\", \"user-home\"],\n    \"./dist/util/colorFile.js\": [\"./dist/util/stripAnsi.js\"],\n    \"./dist/util/columnify.js\": [\"./dist/util/stripAnsi.js\", \"./dist/util/pad.js\"],\n    \"./dist/util/converter.path.js\": [],\n    \"./dist/util/converter.permissions.js\": [],\n    \"./dist/util/converter.date.js\": [],\n    \"./dist/util/expand.js\": [\"glob\"],\n    \"./dist/util/fetch.js\": [\"./dist/util/expand.js\"],\n    \"./dist/util/fileFromPath.js\": [],\n    \"./dist/util/interfacer.js\": [],\n    \"./dist/util/lpad.js\": [\"./dist/util/stripAnsi.js\"],\n    \"./dist/util/pad.js\": [\"./dist/util/stripAnsi.js\"],\n    \"./dist/util/stripAnsi.js\": [],\n    \"./dist/util/walkDir.js\": [],\n    \"./dist/util/walkDirRecursive.js\": [],\n    \"./dist/util/unlinkSync.js\": []\n  },\n  \"packages\": {\n    \"cat\": {\n      \"dependencies\": [\"lodash\", \"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/fetch.js\",\n        \"./dist/util/interfacer.js\",\n        \"./dist/util/lpad.js\",\n        \"./dist/util/stripAnsi.js\",\n        \"./dist/util/expand.js\"\n      ]\n    },\n    \"cp\": {\n      \"dependencies\": [\"lodash\", \"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/expand.js\",\n        \"./dist/util/interfacer.js\"\n      ]\n    },\n    \"false\": {\n      \"dependencies\": [],\n      \"files\": [\n        \"./dist/util/interfacer.js\"\n      ]\n    },\n    \"head\": {\n      \"dependencies\": [\"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/interfacer.js\",\n        \"./dist/util/expand.js\"\n      ]\n    },\n    \"kill\": {\n      \"dependencies\": [\"fkill\", \"lodash\"],\n      \"files\": [\n        \"./dist/util/interfacer.js\"\n      ]\n    },\n    \"ls\": {\n      \"dependencies\": [\"lodash\", \"chalk\", \"filesize\", \"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/colorFile.js\",\n        \"./dist/util/columnify.js\",\n        \"./dist/util/converter.date.js\",\n        \"./dist/util/expand.js\",\n        \"./dist/util/fileFromPath.js\",\n        \"./dist/util/interfacer.js\",\n        \"./dist/util/pad.js\",\n        \"./dist/util/lpad.js\",\n        \"./dist/util/converter.permissions.js\",\n        \"./dist/util/stripAnsi.js\",\n        \"./dist/util/walkDir.js\",\n        \"./dist/util/walkDirRecursive.js\"\n      ]\n    },\n    \"mkdir\": {\n      \"dependencies\": [\"vorpal-autocomplete-fs\"],\n      \"files\": [\"./dist/util/interfacer.js\"]\n    },\n    \"mv\": {\n      \"dependencies\": [\"lodash\", \"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/expand.js\",\n        \"./dist/util/interfacer.js\"\n      ]\n    },\n    \"pwd\": {\n      \"dependencies\": [],\n      \"files\": [\n        \"./dist/util/interfacer.js\"\n      ]\n    },\n    \"sort\": {\n      \"dependencies\": [\"lodash\", \"vorpal-autocomplete-fs\", \"glob\", \"array-shuffle\"],\n      \"files\": [\n        \"./dist/util/fetch.js\",\n        \"./dist/util/interfacer.js\",\n        \"./dist/util/stripAnsi.js\",\n        \"./dist/util/expand.js\"\n      ]\n    },\n    \"tail\": {\n      \"dependencies\": [\"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/interfacer.js\",\n        \"./dist/util/converter.path.js\",\n        \"./dist/util/expand.js\"\n      ]\n    },\n    \"touch\": {\n      \"dependencies\": [\"lodash\", \"fs-extra\", \"vorpal-autocomplete-fs\"],\n      \"files\": [\n        \"./dist/util/interfacer.js\",\n        \"./dist/lib/sugar.js\"\n      ]\n    },\n    \"true\": {\n      \"dependencies\": [],\n      \"files\": [\n        \"./dist/util/interfacer.js\"\n      ]\n    },\n    \"rm\": {\n      \"dependencies\": [\"vorpal-autocomplete-fs\", \"glob\"],\n      \"files\": [\n        \"./dist/util/expand.js\",\n        \"./dist/util/interfacer.js\",\n        \"./dist/util/unlinkSync.js\"\n      ]\n    },\n    \"which\": {\n      \"dependencies\": [\"which\"],\n      \"files\": [\n        \"./dist/util/interfacer.js\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "dist/commands/alias.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar alias = {\n  exec: function exec(args, options) {\n    args = args || [];\n    options = options || {};\n    var vorpal = options.vorpal;\n\n    if (!vorpal) {\n      throw new Error('Alias is not programatically supported.');\n    }\n\n    vorpal._aliases = vorpal._aliases || [];\n\n    if (args.length < 1) {\n      options.p = true;\n    }\n\n    if (typeof args === 'string' || args instanceof String) {\n      args = [args];\n    }\n\n    // Parse incoming args. Accept either:\n    // alias foo=bar, or\n    // alias foo 'bar and so on'.\n    var key = args.join(' ');\n    var value = void 0;\n    if (String(key).indexOf('=') > -1) {\n      var parts = String(key).trim().split('=');\n      key = parts[0];\n      value = parts[1] || value;\n    } else {\n      var _parts = String(key).trim().split(' ');\n      key = _parts.shift();\n      value = _parts.join(' ');\n    }\n\n    // Remove wrapped quotes from value.\n    if (value !== undefined) {\n      value = String(value).replace(/^[\\\"|\\']|[\\\"|\\']$/g, '');\n    }\n\n    // Pull list of aliases\n    var all = void 0;\n    try {\n      all = JSON.parse(vorpal.localStorage.getItem('aliases') || []);\n    } catch (e) {\n      all = [];\n      vorpal.localStorage.removeItem('aliases');\n    }\n\n    if (options.p) {\n      for (var i = 0; i < all.length; ++i) {\n        var item = vorpal.localStorage.getItem('alias|' + all[i]);\n        if (item !== undefined && item !== null) {\n          this.log('alias ' + all[i] + '=\\'' + item + '\\'');\n        }\n      }\n    } else {\n      if (value) {\n        vorpal.localStorage.setItem('alias|' + key, value);\n        all = all.filter(function (val) {\n          return val !== key;\n        });\n        all.push(key);\n      } else {\n        var _item = vorpal.localStorage.getItem('alias|' + key);\n        if (_item !== undefined && _item !== null) {\n          this.log('alias ' + key + '=\\'' + _item + '\\'');\n        } else {\n          this.log('-cash: alias: ' + key + ': not found');\n        }\n      }\n\n      var aliases = {};\n      for (var _i = 0; _i < all.length; ++_i) {\n        var _item2 = vorpal.localStorage.getItem('alias|' + all[_i]);\n        if (_item2 !== undefined && _item2 !== null) {\n          aliases[all[_i]] = _item2;\n        }\n      }\n      vorpal._aliases = aliases;\n    }\n\n    vorpal.localStorage.setItem('aliases', JSON.stringify(all));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return alias;\n  }\n  vorpal.api.alias = alias;\n  vorpal.command('alias [name...]').parse(preparser).option('-p', 'print all defined aliases in a reusable format').action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: alias,\n      args: args.name,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/boilerplate.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\n/**\n * This is a boilerplate for implementing a new command.\n * Delete all of these comments / instructions before finishing.\n */\n\n/**\n * 0. Replace all instances of `cmdName` with\n *    the exact name of the command being implemented.\n */\n\nvar cmdName = {\n\n  /**\n   * The cmdName.exec method is exposed by Cash\n   * as the only public interfacer to your command.\n   */\n\n  exec: function exec(args, options) {\n    options = options || {};\n\n    /**\n     * 1. Validate arg input to include every\n     *    possible form of input, such as:\n     *\n     *    a. as a string:\n     *       cash.foo('bar and so on', {option: true});\n     *\n     *    b. as an array:\n     *       cash.foo(['bar', 'and', 'so', 'on'], {option: true});\n     *\n     *    c. as interpeted through Vorpal:\n     *       cash('foo bar and so on --option');\n     */\n\n    /**\n     * 2. For errors, use `this.log` to print the\n     *    error message to the user, and only return\n     *    the error code (1, 2, etc.)\n     *\n     *    if (args.length < 1) {\n     *      this.log('foo: cannot bar: requires at least one file name');\n     *      return 1;\n     *    }\n     */\n\n    /**\n     * 3. For all other stdout to the user, use `this.log`.\n     *    For large jobs that should stream logging a\n     *    bit at a time, use multiple `this.log` statements\n     *    and cash will handle the heavy lifting of piping\n     *    and returning the final assembled output to the\n     *    user in the case of programmatically executed\n     *    commands.\n     */\n\n    /**\n     * 4. When complete with no errors, return 0;\n     *\n     *    return 0;\n     */\n  }\n};\n\nmodule.exports = function (vorpal) {\n  /**\n   * When do a raw execution of the command\n   * without options, Vorpal is not used. In this\n   * case, the raw command is returned.\n   */\n  if (vorpal === undefined) {\n    return cmdName;\n  }\n  vorpal.api.cmdName = cmdName;\n  /**\n   * Registers the command in Vorpal.\n   * Command strings, options and their\n   * descriptions should exactly emulate\n   * existing commands.\n   */\n  vorpal.command('cmdName [files...]').parse(preparser).option('-o, --option', 'option description').action(function (args, callback) {\n    args.options = args.options || {};\n    /**\n     * The interfacer method does a\n     * lot of heavy lifting on interfacing with\n     * the command properly.\n     */\n    return interfacer.call(this, {\n      command: cmdName,\n      args: args.files, // only pass in what you need from Vorpal\n      options: args.options, // split the options into their own arg\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/cat.js",
    "content": "'use strict';\n\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar fetch = require('./../util/fetch');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar lpad = require('./../util/lpad');\nvar strip = require('./../util/stripAnsi');\n\nvar cat = {\n  exec: function exec(args, options) {\n    var self = this;\n\n    // Input normalization\n    if (args === undefined) {\n      args = {\n        files: []\n      };\n    } else if (typeof args === 'string' || args instanceof String) {\n      args = {\n        files: [args]\n      };\n    } else if (Array.isArray(args)) {\n      args = {\n        files: args\n      };\n    }\n\n    options = options || {};\n\n    // -A handler\n    if (options.showall) {\n      options.shownonprinting = true;\n      options.showends = true;\n      options.showtabs = true;\n    }\n\n    // -e handler\n    if (options.e) {\n      options.shownonprinting = true;\n      options.showends = true;\n    }\n\n    // -t handler\n    if (options.t) {\n      options.shownonprinting = true;\n      options.showtabs = true;\n    }\n\n    var stdout = '';\n    try {\n      var stdin = fetch(args.files, args.stdin, {\n        onDirectory: function onDirectory(name) {\n          return 'cat: ' + name + ': Is a directory';\n        },\n        onInvalidFile: function onInvalidFile(name) {\n          return 'cat: ' + name + ': No such file or directory';\n        }\n      });\n      var ctr = 0;\n      for (var i = 0; i < stdin.length; ++i) {\n        // If -s, squeeze double blank lines to a\n        // single line.\n        if (options.squeezeblank) {\n          stdin[i] = stdin[i].replace(/\\n\\n\\s*\\n/g, '\\n\\n');\n        }\n        if (options.showtabs) {\n          stdin[i] = stdin[i].replace(/\\t/g, '^I');\n        }\n        // Get rid of trailing line break because\n        // node logging does it anyway.\n        stdin[i] = stdin[i].replace(/\\s$/, '');\n        var parts = String(stdin[i]).split('\\n');\n        for (var j = 0; j < parts.length; ++j) {\n          var blank = strip(parts[j]).trim() === '';\n          // If -b, number every non-blank line\n          // If -n, number every line\n          var numbered = !blank && options.numbernonblank || options.number && !options.numbernonblank;\n          if (numbered) {\n            ctr++;\n          }\n          var numStr = numbered ? lpad(String(ctr), 6, ' ') + '  ' : '';\n          // If -E, append a $ to each line end.\n          var dollarStr = options.showends ? '$' : '';\n          var line = numStr + parts[j] + dollarStr;\n          stdout += line + '\\n';\n        }\n      }\n\n      if (stdout.length > 0) {\n        self.log(stdout.slice(0, stdout.length - 1));\n      }\n\n      return 0;\n    } catch (e) {\n      /* istanbul ignore next */\n      self.log(e.stack);\n      /* istanbul ignore next */\n      return 1;\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cat;\n  }\n  vorpal.api.cat = cat;\n  vorpal.command('cat [files...]').parse(preparser).option('-A, --show-all', 'equivalent to -vET').option('-b, --number-nonblank', 'number nonempty output lines, overrides -n').option('-e', 'equivalent to -vE').option('-E, --show-ends', 'display $ at end of each line').option('-n, --number', 'number all output lines').option('-s, --squeeze-blank', 'suppress repeated empty output lines').option('-t', 'equivalent to -vT').option('-T, --show-tabs', 'display TAB characters as ^I').option('-v, --show-nonprinting', 'use ^ and M- notation, except for LFD and TAB') // this doesn't work yet...\n  .autocomplete(fsAutocomplete()).action(function (args, cb) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: cat,\n      args: args,\n      options: args.options,\n      callback: cb\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/cd.js",
    "content": "'use strict';\n\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar delimiter = require('./../delimiter');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar cd = {\n  exec: function exec(dir, options) {\n    var self = this;\n    var vpl = options.vorpal;\n    options = options || {};\n\n    dir = !dir ? delimiter.getHomeDir() : dir;\n\n    // Allow Windows drive letter changes\n    dir = dir && dir.length === 2 && dir[1] === '/' ? dir[0] + ':' : dir;\n\n    try {\n      process.chdir(dir);\n      if (vpl) {\n        delimiter.refresh(vpl);\n      }\n      return 0;\n    } catch (e) {\n      return cd.error.call(self, e, dir);\n    }\n  },\n  error: function error(e, dir) {\n    var status = void 0;\n    var stdout = void 0;\n    if (e.code === 'ENOENT' && e.syscall === 'uv_chdir') {\n      status = 1;\n      stdout = '-bash: cd: ' + dir + ': No such file or directory';\n    } else {\n      status = 2;\n      stdout = e.stack;\n    }\n    this.log(stdout);\n    return status;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cd;\n  }\n  vorpal.api.cd = cd;\n  vorpal.command('cd [dir]').parse(preparser).autocomplete(fsAutocomplete({ directory: true })).action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: cd,\n      args: args.dir,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/clear.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\n\nvar clear = {\n  exec: function exec() {\n    this.log('\\u001b[2J\\u001b[0;0H');\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return clear;\n  }\n  vorpal.api.clear = clear;\n  vorpal.command('clear').action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: clear,\n      args: args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/cp.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar path = require('path');\nvar os = require('os');\n\nvar expand = require('./../util/expand');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar cp = {\n  exec: function exec(args, options) {\n    var self = this;\n    options = options || {};\n\n    args = args === undefined ? [] : args;\n    args = Array.isArray(args) ? args : args.split(' ');\n    args = args.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n\n    options.noclobber = options.force === true ? false : options.noclobber;\n    options.recursive = options.R === true ? true : options.recursive;\n\n    if (args.length < 1) {\n      this.log('cp: missing file operand\\nTry \\'cp --help\\' for more information.');\n      return 1;\n    }\n\n    if (args.length === 1) {\n      this.log('cp: missing destination file operand after ' + args[0] + '\\nTry \\'cp --help\\' for more information.');\n      return 1;\n    }\n\n    args = expand(args);\n\n    var dest = args.pop();\n    var sources = args;\n\n    var exists = fs.existsSync(dest);\n    var stats = exists && fs.statSync(dest);\n\n    // Dest is not existing dir, but multiple sources given\n    if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n      this.log('cp: target ' + dest + ' is not a directory');\n      return 1;\n    }\n\n    // Dest is an existing file, but no -f given\n    if (exists && stats.isFile() && options.noclobber) {\n      // just dont do anything\n      return 0;\n    }\n\n    if (options.recursive) {\n      sources.forEach(function (src, i) {\n        if (src[src.length - 1] === '/') {\n          sources[i] += '*';\n        } else if (fs.statSync(src).isDirectory() && !exists) {\n          sources[i] += '/*';\n        }\n      });\n      try {\n        fs.mkdirSync(dest, parseInt('0777', 8));\n      } catch (e) {\n        // like Unix's cp, keep going even if we can't create dest dir\n      }\n    }\n\n    sources = expand(sources);\n\n    sources.forEach(function (src) {\n      if (!fs.existsSync(src)) {\n        self.log('cp: cannot stat ' + src + ': No such file or directory');\n        return;\n      }\n\n      if (fs.statSync(src).isDirectory()) {\n        if (!options.recursive) {\n          self.log('cp: omitting directory ' + src);\n        } else {\n          // 'cp /a/source dest' should create 'source' in 'dest'\n          var newDest = path.join(dest, path.basename(src));\n          var checkDir = fs.statSync(src);\n          try {\n            fs.mkdirSync(newDest, checkDir.mode);\n          } catch (e) {\n            /* istanbul ignore if */\n            if (e.code !== 'EEXIST') {\n              throw new Error();\n            }\n          }\n          cpdirSyncRecursive.call(self, src, newDest, options);\n        }\n        return;\n      }\n\n      // If here, src is a file\n      // When copying to '/path/dir', iDest = '/path/dir/file1'\n      var iDest = dest;\n      if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) {\n        iDest = path.normalize(dest + '/' + path.basename(src));\n      }\n\n      if (fs.existsSync(iDest) && options.no_force) {\n        return;\n      }\n\n      copyFileSync.call(self, src, iDest);\n    });\n  }\n};\n\nfunction cpdirSyncRecursive(sourceDir, destDir, options) {\n  var self = this;\n  /* istanbul ignore if */\n  if (!options) {\n    options = {};\n  }\n  var checkDir = fs.statSync(sourceDir);\n  try {\n    fs.mkdirSync(destDir, checkDir.mode);\n  } catch (e) {\n    /* istanbul ignore if */\n    if (e.code !== 'EEXIST') {\n      throw e;\n    }\n  }\n  var files = fs.readdirSync(sourceDir);\n  for (var i = 0; i < files.length; i++) {\n    var srcFile = sourceDir + '/' + files[i];\n    var destFile = destDir + '/' + files[i];\n    var srcFileStat = fs.lstatSync(srcFile);\n    if (srcFileStat.isDirectory()) {\n      // recursion this thing right on back.\n      cpdirSyncRecursive.call(self, srcFile, destFile, options);\n    } else if (srcFileStat.isSymbolicLink()) {\n      var symlinkFull = fs.readlinkSync(srcFile);\n      fs.symlinkSync(symlinkFull, destFile, os.platform() === 'win32' ? 'junction' : null);\n      // At this point, we've hit a file actually worth copying... so copy it on over.\n    } else if (fs.existsSync(destFile) && options.noclobber) {\n        // be silent\n      } else {\n          copyFileSync.call(self, srcFile, destFile);\n        }\n  }\n}\n\nfunction copyFileSync(src, dest) {\n  /* istanbul ignore if */\n  if (!fs.existsSync(src)) {\n    this.log('cp: cannot stat ' + src + ': No such file or directory');\n    return;\n  }\n\n  var BUF_LENGTH = 64 * 1024;\n  var buf = new Buffer(BUF_LENGTH);\n  var bytesRead = BUF_LENGTH;\n  var pos = 0;\n  var fdr = null;\n  var fdw = null;\n\n  try {\n    fdr = fs.openSync(src, 'r');\n  } catch (e) {\n    /* istanbul ignore next */\n    this.log('cp: cannot open ' + src + ': ' + e.code);\n    /* istanbul ignore next */\n    return;\n  }\n\n  try {\n    fdw = fs.openSync(dest, 'w');\n  } catch (e) {\n    /* istanbul ignore next */\n    this.log('cp: cannot write to destination file ' + dest + ': ' + e.code);\n    /* istanbul ignore next */\n    return;\n  }\n\n  while (bytesRead === BUF_LENGTH) {\n    bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos);\n    fs.writeSync(fdw, buf, 0, bytesRead);\n    pos += bytesRead;\n  }\n\n  fs.closeSync(fdr);\n  fs.closeSync(fdw);\n  fs.chmodSync(dest, fs.statSync(src).mode);\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cp;\n  }\n  vorpal.api.cp = cp;\n  vorpal.command('cp [args...]').parse(preparser).option('-f, --force', 'do not prompt before overwriting').option('-n, --no-clobber', 'do not overwrite an existing file').option('-r, --recursive', 'copy directories recursively').option('-R', 'copy directories recursively').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: cp,\n      args: args.args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/echo.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar echo = {\n  exec: function exec(arg, options) {\n    var self = this;\n    options = options || {};\n\n    try {\n      var text = arg || '';\n      text = !Array.isArray(text) ? [text] : text;\n      var result = text.join(' ');\n      var out = '';\n      if (options.e && !options.E) {\n        for (var i = 0; i < result.length; ++i) {\n          var nxt = result[i] + (result[i + 1] || '');\n          if (nxt === '\\\\b') {\n            out = out.slice(0, out.length - 1);\n            i++;\n          } else if (nxt === '\\\\c') {\n            break;\n          } else if (nxt === '\\\\n') {\n            out += '\\n';\n            i++;\n          } else if (nxt === '\\\\r') {\n            out += '\\r';\n            i++;\n          } else if (nxt === '\\\\t') {\n            out += '     ';\n            i++;\n          } else if (nxt === '\\\\\\\\') {\n            out += '\\\\';\n            i += 2;\n          } else {\n            out += result[i];\n          }\n        }\n        result = out;\n      }\n\n      // Bug: If nothing is passed, ensure we keep\n      // a blank line. Vorpal is designed to just\n      // eat blank lines, so we have a problem.\n      result = result === '' ? '' : result;\n\n      this.log(result);\n      return 0;\n    } catch (e) {\n      /* istanbul ignore next */\n      return echo.error.call(self, e);\n    }\n  },\n  error: function error(e) {\n    /* istanbul ignore next */\n    this.log(e.stack);\n    /* istanbul ignore next */\n    return 2;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return echo;\n  }\n  vorpal.api.echo = echo;\n  vorpal.command('echo [arg...]').parse(preparser).option('-e', 'enable interpretation of the following backslash escapes').option('-E', 'explicitly suppress interpretation of backslash escapes').action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: echo,\n      args: args.arg,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/export.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar _export = {\n  exec: function exec(args, options) {\n    args = args || [];\n    options = options || {};\n\n    if (args.length < 1) {\n      options.p = true;\n    }\n\n    if (typeof args === 'string' || args instanceof String) {\n      args = [args];\n    }\n\n    // Parse similarly to how `alias` does\n    var id = args.join(' ');\n    var value = '';\n    if (String(id).indexOf('=') > -1) {\n      var parts = String(id).trim().split('=');\n      id = parts[0];\n      value = parts[1] || value;\n      if (value.match(/^\".*\"$/)) {\n        value = JSON.parse(value);\n      } else {\n        var regMatch = value.match(/^'(.*)'$/);\n        if (regMatch && regMatch[1]) {\n          value = regMatch[1];\n        }\n      }\n    } else {\n      var _parts = String(id).trim().split(' ');\n      id = _parts.shift();\n      value = _parts.join(' ') || null;\n    }\n\n    var validIdRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n    if (options.p) {\n      for (var name in process.env) {\n        if (process.env.hasOwnProperty(name)) {\n          this.log('declare -x ' + String(name) + '=' + JSON.stringify(process.env[name]).replace(/\\$/g, '\\\\$'));\n        }\n      }\n    } else if (id.match(validIdRegex)) {\n      process.env[id] = value !== null ? value : process.env[id];\n    } else {\n      this.log('-cash: export: `' + id + '\\': not a valid identifier');\n      return 1;\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _export;\n  }\n  vorpal.api.export = _export;\n  vorpal.command('export [name...]').parse(preparser).option('-p', 'print all defined aliases in a reusable format').action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: _export,\n      args: args.name,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/false.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\n\nvar _false = {\n  exec: function exec() {\n    // Always return 1\n    return 1;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _false;\n  }\n  vorpal.api.false = _false;\n  vorpal.command('false').action(function (args, callback) {\n    return interfacer.call(this, {\n      command: _false,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/grep.js",
    "content": "'use strict';\n\nmodule.exports = require('vorpal-grep');"
  },
  {
    "path": "dist/commands/head.js",
    "content": "'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar interfacer = require('./../util/interfacer');\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar expand = require('./../util/expand');\n\nvar head = {\n  exec: function exec(args, options) {\n    options = options || {};\n    args = args || '';\n    var source = args.stdin === undefined ? 'files' : 'stdin';\n\n    var lines = options.lines ? Math.abs(options.lines) : 10;\n    if (!Number.isInteger(lines)) {\n      this.log('head: ' + options.lines + ': invalid number of lines');\n      return 0;\n    }\n\n    /* istanbul ignore next */\n    if (source === 'stdin') {\n      var _stdout = head.readLines(args.stdin[0], lines);\n      _stdout = _stdout.replace(/\\n$/, '');\n      if (_stdout.trim() !== '') {\n        this.log(_stdout);\n      }\n      return 0;\n    }\n\n    var files = args.files || args;\n    files = (typeof files === 'undefined' ? 'undefined' : _typeof(files)) === 'object' && files !== null && !Array.isArray(files) ? [] : files;\n    files = files === undefined ? [] : files;\n    files = typeof files === 'string' ? String(files).split(' ') : files;\n    files = files.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n    files = expand(files);\n\n    var stdout = '';\n    var verbose = files.length > 1 && !options.silent || options.verbose;\n\n    for (var i = 0; i < files.length; i++) {\n      try {\n        var content = fs.readFileSync(files[i]).toString();\n        if (verbose) {\n          stdout += (i > 0 ? '\\n' : '') + '==> ' + files[i] + ' <==\\n';\n        }\n        stdout += head.readLines(content, lines);\n      } catch (e) {\n        stdout += 'head: cannot open ' + files[i] + ' for reading: No such file or directory';\n      }\n    }\n\n    stdout = stdout.replace(/\\n$/, '');\n    if (stdout.trim() !== '') {\n      this.log(stdout);\n    }\n\n    return 0;\n  },\n  readLines: function readLines(content, numberOfLines) {\n    var stdout = '';\n    var contentArray = content.split('\\n');\n    var linesToRead = numberOfLines >= contentArray.length ? contentArray.length : numberOfLines;\n    for (var i = 0; i < linesToRead; i++) {\n      if (stdout === '') {\n        stdout = contentArray[i] + '\\n';\n        continue;\n      }\n      stdout += contentArray[i] + '\\n';\n    }\n    return stdout;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return head;\n  }\n  vorpal.api.head = head;\n  vorpal.command('head [files...]').option('-n, --lines [number]', 'print the first K lines instead of the first 10').option('-q, --silent', 'Suppresses printing of headers when multiple files are being examined.').option('-v, --verbose', 'Always output headers giving file names.').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: head,\n      args: args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/kill.js",
    "content": "'use strict';\n\nvar fkill = require('fkill');\nvar os = require('os');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar usage = 'kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]';\nvar windows = os.platform().indexOf('win') > -1;\nvar signals = {\n  SIGKILL: 9,\n  SIGTERM: 15,\n  KILL: 9,\n  TERM: 15,\n  9: 'KILL',\n  15: 'TERM'\n};\n\nvar kill = {\n  exec: function exec(args, options) {\n    options = options || {};\n\n    var procs = args;\n    procs = procs === undefined ? [] : procs;\n    procs = typeof procs === 'string' ? String(procs).split(' ') : procs;\n    procs = procs.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n\n    function log(str) {\n      if (options.vorpal) {\n        options.vorpal.log(str);\n      } else {\n        /* istanbul ignore next */\n        console.log(str);\n      }\n    }\n\n    if (options.l !== undefined) {\n      if (options.l === true) {\n        this.log(' 9) SIGKILL   15) SIGTERM');\n        return 0;\n      }\n      if (signals[options.l]) {\n        this.log(signals[options.l]);\n        return 0;\n      }\n      this.log('-cash: kill: ' + options.l + ': invalid signal specification');\n      return 0;\n    }\n\n    if (procs.length < 1) {\n      this.log(usage);\n      return 0;\n    }\n\n    var forced = options['9'] === true || options.n === 9 || String(options.s).toLowerCase() === 'sigkill' || String(options.s).toLowerCase() === 'kill';\n    var opts = { force: forced };\n\n    var _loop = function _loop(i) {\n      var proc = procs[i];\n      proc = !isNaN(proc) ? parseFloat(proc) : proc;\n      proc = windows && isNaN(proc) && proc.indexOf('.') === -1 ? proc + '.exe' : proc;\n      fkill(proc, opts).then(function () {\n        // .. chill\n      }).catch(function (err) {\n        if (String(err.message).indexOf('failed') > -1) {\n          log('-cash: kill: (' + proc + ') - No such process');\n        }\n      });\n    };\n\n    for (var i = 0; i < procs.length; ++i) {\n      _loop(i);\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return kill;\n  }\n  vorpal.api.kill = kill;\n  vorpal.command('kill [process...]').parse(preparser).option('-9', 'sigkill').option('-s [sig]', 'sig is a signal name').option('-n [sig]', 'sig is a signal number').option('-l [sigspec]', 'list the signal names').action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: kill,\n      args: args.process,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/less.js",
    "content": "'use strict';\n\nmodule.exports = require('vorpal-less');"
  },
  {
    "path": "dist/commands/ls.js",
    "content": "'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar chalk = require('chalk');\nvar filesize = require('filesize');\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar os = require('os');\n\nvar expand = require('./../util/expand');\nvar colorFile = require('./../util/colorFile');\nvar columnify = require('./../util/columnify');\nvar dateConverter = require('./../util/converter.date');\nvar fileFromPath = require('./../util/fileFromPath');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar pad = require('./../util/pad');\nvar lpad = require('./../util/lpad');\nvar permissionsConverter = require('./../util/converter.permissions');\nvar strip = require('./../util/stripAnsi');\nvar walkDir = require('./../util/walkDir');\nvar walkDirRecursive = require('./../util/walkDirRecursive');\n\nvar pads = { pad: pad, lpad: lpad };\n\nvar ls = {\n\n  self: null,\n\n  /**\n   * Main command execution.\n   *\n   * @return {Object} { status, stdout }\n   * @api public\n   * @param paths\n   * @param options\n   */\n  exec: function exec(paths, options) {\n    ls.self = this;\n    paths = paths !== null && !Array.isArray(paths) && (typeof paths === 'undefined' ? 'undefined' : _typeof(paths)) === 'object' ? paths.paths : paths;\n    paths = paths || ['.'];\n    paths = Array.isArray(paths) ? paths : [paths];\n    paths = expand(paths);\n\n    options = options || {};\n\n    var preSortedPaths = ls.preSortPaths(paths);\n\n    var dirResults = [];\n    for (var i = 0; i < preSortedPaths.dirs.length; ++i) {\n      if (options.recursive) {\n        var result = ls.execDirRecursive(preSortedPaths.dirs[i], options);\n        dirResults = dirResults.concat(result);\n      } else {\n        dirResults.push(ls.execDir(preSortedPaths.dirs[i], options));\n      }\n    }\n\n    var stdout = '';\n    if (preSortedPaths.files.length > 0) {\n      stdout += ls.execLsOnFiles('.', preSortedPaths.files, options).results;\n    }\n\n    var dirOutput = ls.formatAll(dirResults, options, dirResults.length + preSortedPaths.files.length > 1);\n    stdout += stdout && dirOutput ? '\\n\\n' + dirOutput : dirOutput;\n    if (strip(stdout).trim() !== '') {\n      ls.self.log(String(stdout).replace(/\\\\/g, '/'));\n    }\n\n    return 0;\n  },\n  preSortPaths: function preSortPaths(paths) {\n    var dirs = [];\n    var files = [];\n\n    for (var i = 0; i < paths.length; i++) {\n      var p = paths[i];\n      try {\n        var stat = fs.statSync(p);\n        if (stat.isDirectory()) {\n          dirs.push(p);\n        } else if (stat.isFile()) {\n          files.push({\n            file: p,\n            data: stat\n          });\n        }\n      } catch (e) {\n        e.syscall = 'scandir';\n        ls.error(p, e);\n      }\n    }\n    files.sort();\n    dirs.sort();\n\n    return { files: files, dirs: dirs };\n  },\n\n\n  /**\n   * Returns ls stderr and response codes\n   * for errors.\n   *\n   * @param {String} path\n   * @param {Error} e\n   * @param {String} e.code\n   * @param {String} e.syscall\n   * @param {String} e.stack\n   * @api private\n   */\n  error: function error(path, e) {\n    var status = void 0;\n    var stdout = void 0;\n\n    if (e.code === 'ENOENT' && e.syscall === 'scandir') {\n      status = 1;\n      stdout = 'ls: cannot access ' + path + ': No such file or directory';\n    } else {\n      status = 2;\n      stdout = e.stack;\n    }\n\n    ls.self.log(stdout);\n    return { status: status, stdout: stdout };\n  },\n\n\n  /**\n   * Recursively executes `execDir`.\n   * For use with `ls -R`.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @return {Array} results\n   * @api private\n   */\n\n  execDirRecursive: function execDirRecursive(path, options) {\n    var self = this;\n    var results = [];\n    walkDirRecursive(path, function (pth) {\n      var result = self.execDir(pth, options);\n      results.push(result);\n    });\n\n    return results;\n  },\n\n\n  /**\n   * Executes `ls` functionality\n   * for a given directory.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @return {{path: String, size: *, results: *}} results\n   * @api private\n   */\n  execDir: function execDir(path, options) {\n    var rawFiles = [];\n\n    function pushFile(file, data) {\n      rawFiles.push({\n        file: file,\n        data: data\n      });\n    }\n\n    // Add in implied current and parent dirs.\n    pushFile('.', fs.statSync('.'));\n    pushFile('..', fs.statSync('..'));\n\n    // Walk the passed in directory,\n    // pushing the results into `rawFiles`.\n    walkDir(path, pushFile, ls.error);\n\n    var o = ls.execLsOnFiles(path, rawFiles, options);\n    o.path = path;\n    return o;\n  },\n  execLsOnFiles: function execLsOnFiles(path, rawFiles, options) {\n    var files = [];\n    var totalSize = 0;\n\n    // Sort alphabetically be default,\n    // unless -U is specified, in which case\n    // we don't sort.\n    if (!options.U) {\n      rawFiles = rawFiles.sort(function (a, b) {\n        // Sort by size.\n        if (options.S) {\n          // Hack for windows - a directory lising\n          // in linux says the size is 4096, and Windows\n          // it's 0, leading to inconsistent sorts based\n          // on size, and failing tests.\n          var win = os.platform() === 'win32';\n          a.data.size = win && a.data.isDirectory() && a.data.size === 0 ? 4096 : a.data.size;\n          b.data.size = win && b.data.isDirectory() && b.data.size === 0 ? 4096 : b.data.size;\n          return a.data.size > b.data.size ? -1 : a.data.size < b.data.size ? 1 : 0;\n        }\n        if (options.t) {\n          // Sort by date modified.\n          return a.data.mtime < b.data.mtime ? 1 : b.data.mtime < a.data.mtime ? -1 : 0;\n        }\n        // Sort alphabetically - default.\n        var aFileName = fileFromPath(a.file).trim().toLowerCase().replace(/\\W/g, '');\n        var bFileName = fileFromPath(b.file).trim().toLowerCase().replace(/\\W/g, '');\n        return aFileName > bFileName ? 1 : aFileName < bFileName ? -1 : 0;\n      });\n    }\n\n    // Reverse whatever sort the user specified.\n    if (options.reverse) {\n      rawFiles.reverse();\n    }\n\n    var _loop = function _loop(i) {\n      var file = rawFiles[i].file;\n      var data = rawFiles[i].data;\n      var fileShort = fileFromPath(file);\n      var dotted = fileShort && fileShort.charAt(0) === '.';\n      var implied = fileShort === '..' || fileShort === '.';\n      var type = data.isDirectory() ? 'd' : '-';\n      var permissions = permissionsConverter.modeToRWX(data.mode);\n      var hardLinks = data.nlink;\n      var size = options.humanreadable ? filesize(data.size, { unix: true }) : data.size;\n      var modified = dateConverter.unix(data.mtime);\n      var owner = data.uid;\n      var group = data.gid;\n      var inode = data.ino;\n\n      totalSize += data.size;\n\n      var fileName = fileShort;\n\n      // If --classify, add '/' to end of folders.\n      fileName = options.classify && data.isDirectory() ? fileName + '/' : fileName;\n\n      // If getting --directory, give full path.\n      fileName = options.directory && file === '.' ? path : fileName;\n\n      // Color the files based on $LS_COLORS\n      fileName = data.isFile() ? colorFile(fileName) : fileName;\n\n      // If not already colored and is executable,\n      // make it green\n      var colored = strip(fileName) !== fileName;\n      if (String(permissions).indexOf('x') > -1 && !colored && data.isFile()) {\n        fileName = chalk.green(fileName);\n      }\n\n      // If --quote-name, wrap in double quotes;\n      fileName = options.quotename ? '\"' + fileName + '\"' : fileName;\n\n      // Make directories cyan.\n      fileName = data.isDirectory() ? chalk.cyan(fileName) : fileName;\n\n      var include = function () {\n        var directory = options.directory;\n        var all = options.all;\n        var almostAll = options.almostall;\n        var result = false;\n        if (directory && file !== '.') {\n          result = false;\n        } else if (!dotted) {\n          result = true;\n        } else if (all) {\n          result = true;\n        } else if (!implied && almostAll) {\n          result = true;\n        } else if (directory && file === '.') {\n          result = true;\n        }\n        return result;\n      }();\n\n      var details = [type + permissions, hardLinks, owner, group, size, modified, fileName];\n\n      if (options.inode) {\n        details.unshift(inode);\n      }\n\n      var result = options.l && !options.x ? details : fileName;\n\n      if (include) {\n        files.push(result);\n      }\n    };\n\n    for (var i = 0; i < rawFiles.length; ++i) {\n      _loop(i);\n    }\n\n    return ls.formatDetails(files, totalSize, options);\n  },\n  formatDetails: function formatDetails(files, totalSize, options) {\n    var result = void 0;\n\n    // If we have the detail view, draw out\n    // all of the details of each file.\n    // Otherwise, just throw the file names\n    // into columns.\n    if (Array.isArray(files[0])) {\n      var longest = {};\n      for (var i = 0; i < files.length; ++i) {\n        for (var j = 0; j < files[i].length; ++j) {\n          var len = String(files[i][j]).length;\n          longest[j] = longest[j] || 0;\n          longest[j] = len > longest[j] ? len : longest[j];\n        }\n      }\n\n      var newFiles = [];\n      for (var _i = 0; _i < files.length; ++_i) {\n        var glob = '';\n        for (var _j = 0; _j < files[_i].length; ++_j) {\n          var padFn = _j === files[_i].length - 1 ? 'pad' : 'lpad';\n          if (_j === files[_i].length - 1) {\n            glob += String(files[_i][_j]);\n          } else {\n            glob += pads[padFn](String(files[_i][_j]), longest[_j], ' ') + ' ';\n          }\n        }\n        newFiles.push(String(glob));\n      }\n      result = newFiles.join('\\n');\n    } else if (options['1']) {\n      result = files.join('\\n');\n    } else {\n      var opt = {};\n      if (options.width) {\n        opt.width = options.width;\n      }\n\n      result = columnify(files, opt);\n    }\n\n    return {\n      size: options.humanreadable ? filesize(totalSize, { unix: true }) : totalSize,\n      results: result\n    };\n  },\n\n\n  /**\n   * Concatenates the results of multiple\n   * `execDir` functions into their proper\n   * form based on options provided.\n   *\n   * @param {Array} results\n   * @param {Object} options\n   * @param {boolean} showName\n   * @return {String} stdout\n   * @api private\n   */\n\n  formatAll: function formatAll(results, options, showName) {\n    var stdout = '';\n    if (showName) {\n      for (var i = 0; i < results.length; ++i) {\n        stdout += results[i].path + ':\\n';\n        if (options.l) {\n          stdout += 'total ' + results[i].size + '\\n';\n        }\n        stdout += results[i].results;\n        if (i !== results.length - 1) {\n          stdout += '\\n\\n';\n        }\n      }\n    } else if (results.length === 1) {\n      if (options.l && !options.x) {\n        stdout += 'total ' + results[0].size + '\\n';\n      }\n      stdout += results[0].results;\n    }\n    return stdout;\n  }\n};\n\n/**\n * Expose as a Vorpal extension.\n */\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return ls;\n  }\n  vorpal.api.ls = ls;\n  vorpal.command('ls [paths...]').parse(preparser).option('-a, --all', 'do not ignore entries starting with .').option('-A, --almost-all', 'do not list implied . and ..').option('-d, --directory', 'list directory entries instead of contents, and do not dereference symbolic links').option('-F, --classify', 'append indicator (one of */=>@|) to entries').option('-h, --human-readable', 'with -l, print sizes in human readable format (e.g., 1K 234M 2G)').option('-i, --inode', 'print the index number of each file').option('-l', 'use a long listing format').option('-Q, --quote-name', 'enclose entry names in double quotes').option('-r, --reverse', 'reverse order while sorting').option('-R, --recursive', 'list subdirectories recursively').option('-S', 'sort by file size').option('-t', 'sort by modification time, newest first').option('-U', 'do not sort; list entries in directory order').option('-w, --width [COLS]', 'assume screen width instead of current value').option('-x', 'list entries by lines instead of columns').option('-1', 'list one file per line').autocomplete(fsAutocomplete()).action(function (args, cb) {\n    return interfacer.call(this, {\n      command: ls,\n      args: args.paths,\n      options: args.options,\n      callback: cb\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/mkdir.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar mkdir = {\n  exec: function exec(args, options) {\n    var self = this;\n    var dirs = args || [];\n    options = options || {};\n\n    if (typeof dirs === 'string') {\n      dirs = dirs.split(' ');\n    }\n\n    dirs = dirs.filter(function (str) {\n      return String(str).trim() !== '';\n    });\n\n    if (dirs.length < 1) {\n      this.log('mkdir: missing operand\\nTry \\'mkdir --help\\' for more information.');\n    }\n\n    dirs.forEach(function (dir) {\n      if (fs.existsSync(dir)) {\n        if (!options.parents) {\n          self.log('mkdir: cannot create directory ' + dir + ': File exists');\n        }\n        return;\n      }\n\n      // Base dir does not exist, and no -p option given\n      var baseDir = path.dirname(dir);\n      if (!fs.existsSync(baseDir) && !options.parents) {\n        self.log('mkdir: cannot create directory ' + dir + ': No such file or directory');\n        return;\n      }\n\n      if (options.parents) {\n        mkdirSyncRecursive.call(self, dir, options);\n      } else {\n        fs.mkdirSync(dir, parseInt('0777', 8));\n        if (options.verbose) {\n          self.log('mkdir: created directory ' + dir);\n        }\n      }\n    });\n    return 0;\n  }\n};\n\nfunction mkdirSyncRecursive(dir, options) {\n  var baseDir = path.dirname(dir);\n  if (fs.existsSync(baseDir)) {\n    fs.mkdirSync(dir, parseInt('0777', 8));\n    if (options.verbose) {\n      this.log('mkdir: created directory ' + dir);\n    }\n    return;\n  }\n  mkdirSyncRecursive.call(this, baseDir, options);\n  fs.mkdirSync(dir, parseInt('0777', 8));\n  if (options.verbose) {\n    this.log('mkdir: created directory ' + dir);\n  }\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return mkdir;\n  }\n  vorpal.api.mkdir = mkdir;\n  vorpal.command('mkdir [directory...]').parse(preparser).option('-p, --parents', 'no error if existing, make parent directories as needed').option('-v, --verbose', 'print a message for each created directory').autocomplete(fsAutocomplete({ directory: true })).action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: mkdir,\n      args: args.directory,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/mv.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar path = require('path');\n\nvar expand = require('./../util/expand');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar mv = {\n  exec: function exec(args, options) {\n    var self = this;\n    options = options || {};\n\n    args = args === undefined ? [] : args;\n    args = Array.isArray(args) ? args : args.split(' ');\n    args = args.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n\n    options.noclobber = options.force === true ? false : options.noclobber;\n\n    if (args.length < 1) {\n      this.log('mv: missing file operand\\nTry \\'mv --help\\' for more information.');\n      return 1;\n    }\n\n    if (args.length === 1) {\n      this.log('mv: missing destination file operand after ' + args[0] + '\\nTry \\'mv --help\\' for more information.');\n      return 1;\n    }\n\n    args = expand(args);\n\n    var dest = args.pop();\n    var sources = args;\n\n    var exists = fs.existsSync(dest);\n    var stats = exists && fs.statSync(dest);\n\n    // Dest is not existing dir, but multiple sources given\n    if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n      this.log('mv: target ' + dest + ' is not a directory');\n      return 1;\n    }\n\n    // Dest is an existing file, but no -f given\n    if (exists && stats.isFile() && options.noclobber) {\n      // just dont do anything\n      return 0;\n    }\n\n    if (options.striptrailingslashes) {\n      sources = sources.map(function (src) {\n        return String(src).replace(/\\/$/g, '');\n      });\n    }\n\n    sources.forEach(function (src) {\n      if (!fs.existsSync(src)) {\n        self.log('mv: cannot stat ' + src + ': No such file or directory');\n        return;\n      }\n\n      // When copying to '/path/dir', iDest = '/path/dir/file1'\n      var iDest = dest;\n      if (exists && stats.isDirectory()) {\n        iDest = path.normalize(dest + '/' + path.basename(src));\n      }\n\n      // If the file exists and we're not clobbering, skip.\n      if (fs.existsSync(iDest) && options.noclobber) {\n        return;\n      }\n\n      if (path.resolve(src) === path.dirname(path.resolve(iDest))) {\n        self.log('mv: ' + src + ' and ' + iDest + ' are the same file');\n        return;\n      }\n\n      fs.renameSync(src, iDest);\n      if (options.verbose === true) {\n        self.log(String(src + ' -> ' + iDest).replace(/\\\\/g, '/'));\n      }\n    });\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return mv;\n  }\n  vorpal.api.mv = mv;\n  vorpal.command('mv [args...]').parse(preparser).option('-f, --force', 'do not prompt before overwriting').option('-n, --no-clobber', 'do not overwrite an existing file').option('--striptrailingslashes', 'remove any trailing slashes from each source') // vorpal bug, need to add dashes between words\n  .option('-v, --verbose', 'explain what is being done').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: mv,\n      args: args.args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/pwd.js",
    "content": "'use strict';\n\nvar path = require('path');\n\nvar interfacer = require('./../util/interfacer');\n\nvar pwd = {\n  exec: function exec() {\n    this.log(path.resolve(process.cwd()).replace(/\\\\/g, '/'));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return pwd;\n  }\n  vorpal.api.pwd = pwd;\n  vorpal.command('pwd [files...]').action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: pwd,\n      args: args.files,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/rm.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar expand = require('./../util/expand');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar unlinkSync = require('./../util/unlinkSync');\n\nvar rm = {\n  exec: function exec(args, options) {\n    var self = this;\n    options = options || {};\n    options.recursive = options.R ? options.R : options.recursive;\n\n    var files = args;\n    files = files === undefined ? [] : files;\n    files = typeof files === 'string' ? [files] : files;\n\n    files = expand(files);\n\n    files.forEach(function (file) {\n      if (!fs.existsSync(file)) {\n        // Path does not exist, no force flag given\n        if (!options.force) {\n          self.log('rm: cannot remove ' + file + ': No such file or directory');\n          return 2;\n        }\n        /* istanbul ignore next */\n        return 0;\n      }\n\n      var stats = fs.lstatSync(file);\n      if (stats.isFile() || stats.isSymbolicLink()) {\n        if (options.force) {\n          unlinkSync(file);\n          return 0;\n        }\n\n        if (isWriteable(file)) {\n          unlinkSync(file);\n        } else {\n          /* istanbul ignore next */\n          self.log('rm: cannot remove ' + file + ': permission denied');\n          /* istanbul ignore next */\n          return 2;\n        }\n        return 0;\n      }\n\n      // Path is an existing directory, but no -r flag given\n      if (stats.isDirectory() && !options.recursive) {\n        self.log('rm: cannot remove: path is a directory');\n        return 2;\n      }\n\n      // Recursively remove existing directory\n      if (stats.isDirectory() && options.recursive) {\n        rmdirSyncRecursive.call(self, file, options.force, options.dir);\n      }\n    });\n  }\n};\n\nfunction rmdirSyncRecursive(dir, force, removeEmptyDir) {\n  var self = this;\n  var files = void 0;\n  files = fs.readdirSync(dir);\n\n  // Loop through and delete everything in the sub-tree after checking it\n  for (var i = 0; i < files.length; i++) {\n    var file = dir + '/' + files[i];\n    var currFile = fs.lstatSync(file);\n\n    if (currFile.isDirectory()) {\n      // Recursive function back to the beginning\n      rmdirSyncRecursive(file, force, removeEmptyDir);\n    } else if (currFile.isSymbolicLink()) {\n      // Unlink symlinks\n      /* istanbul ignore next */\n      if (force || isWriteable(file)) {\n        try {\n          unlinkSync(file);\n        } catch (e) {\n          self.log('rm: cannot remove ' + file + ': code ' + e.code);\n          return 2;\n        }\n      }\n    } else if (force || isWriteable(file)) {\n      // Assume it's a file.\n      try {\n        unlinkSync(file);\n      } catch (e) {\n        /* istanbul ignore next */\n        self.log('rm: cannot remove ' + file + ': code ' + e.code);\n        /* istanbul ignore next */\n        return 2;\n      }\n    }\n  }\n\n  // Now that we know everything in the sub-tree has been deleted,\n  // we can delete the main directory.\n  var result = void 0;\n  try {\n    // Retry on windows, sometimes it takes a little time before all the files in the directory are gone\n    var start = Date.now();\n    while (true) {\n      try {\n        result = fs.rmdirSync(dir);\n        /* istanbul ignore next */\n        if (fs.existsSync(dir)) {\n          throw new Error('EAGAIN');\n        }\n        break;\n      } catch (er) {\n        // In addition to error codes, also check if the directory still exists and loop again if true\n        /* istanbul ignore next */\n        if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) {\n          if (Date.now() - start > 1000) {\n            throw er;\n          }\n          /* istanbul ignore next */\n        } else if (er.code === 'ENOENT') {\n            // Directory did not exist, deletion was successful\n            break;\n            /* istanbul ignore next */\n          } else {\n              throw er;\n            }\n      }\n    }\n  } catch (e) {\n    /* istanbul ignore next */\n    self.log('rm: cannot remove directory ' + dir + ': code ' + e.code);\n    /* istanbul ignore next */\n    return 2;\n  }\n  return result;\n}\n\n// Hack to determine if file has write permissions for current user\n// Avoids having to check user, group, etc, but it's probably slow.\nfunction isWriteable(file) {\n  var writePermission = true;\n  try {\n    var __fd = fs.openSync(file, 'a');\n    fs.closeSync(__fd);\n  } catch (e) {\n    /* istanbul ignore next */\n    writePermission = false;\n  }\n\n  return writePermission;\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return rm;\n  }\n  vorpal.api.rm = rm;\n  vorpal.command('rm [files...]').parse(preparser).option('-f, --force', 'ignore nonexistent files and arguments, never prompt').option('-r, --recursive', 'remove directories and their contents recursively').option('-R', 'remove directories and their contents recursively').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: rm,\n      args: args.files,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/sort.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar fetch = require('./../util/fetch');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar strip = require('./../util/stripAnsi');\nvar shuffle = require('array-shuffle');\n\nvar sort = {\n\n  counter: 0,\n\n  stdin: '',\n\n  exec: function exec(args, options) {\n    var self = this;\n\n    // Hack to handle multiple calls\n    // due to fragmented stdin, such as\n    // by piping. In essence, we're waiting\n    // 100 milliseconds for all of the\n    // requests to come in, and then running\n    // sort. Only applies when sort is called\n    // through a piped command.\n    /* istanbul ignore next */\n    if (args && args.stdin && options.bypass !== true) {\n      sort.counter++;\n      sort.stdin += args.stdin + '\\n';\n      if (sort.counter === 1) {\n        setTimeout(function () {\n          sort.counter = 0;\n          args.stdin = sort.stdin;\n          sort.stdin = '';\n          options.bypass = true;\n          sort.exec.call(self, args, options);\n        }, 100);\n      }\n      return;\n    }\n    sort.counter = 0;\n    sort.stdin = '';\n\n    // Input normalization\n    if (args === undefined) {\n      args = {\n        files: []\n      };\n    } else if (typeof args === 'string' || args instanceof String) {\n      args = {\n        files: [args]\n      };\n    } else if (Array.isArray(args)) {\n      args = {\n        files: args\n      };\n    }\n\n    options = options || {};\n\n    function log(stdout) {\n      if (options.output) {\n        if (options.output === true) {\n          self.log('sort: option \\'--output\\' requires an argument\\nTry \\'sort --help\\' for more information.');\n          return 0;\n        }\n        try {\n          fs.writeFileSync(options.output, stdout);\n          return 0;\n        } catch (e) {\n          if (e.code === 'ENOENT') {\n            self.log('sort: open failed: ' + options.output + ': No such file or directory');\n          } else {\n            /* istanbul ignore next */\n            self.log('sort: open failed: ' + options.output + ': ' + e.code);\n          }\n          return 2;\n        }\n      } else {\n        self.log(stdout);\n      }\n    }\n\n    try {\n      var stdin = fetch(args.files, args.stdin, {\n        onDirectory: function onDirectory(name) {\n          /* istanbul ignore next */\n          return 'sort: read failed: ' + name + ': Is a directory';\n        },\n        onInvalidFile: function onInvalidFile(name) {\n          /* istanbul ignore next */\n          return 'sort: cannot read: ' + name + ': No such file or directory';\n        }\n      });\n\n      var combined = '';\n      for (var i = 0; i < stdin.length; ++i) {\n        // Get rid of trailing line break because\n        // node logging does it anyway.\n        combined += stdin[i];\n      }\n\n      combined = combined.replace(/\\s$/, '');\n      var parts = String(combined).split('\\n');\n\n      if (options.check) {\n        // Check if the thing was already sorted.\n        var original = String(combined).split('\\n');\n        var disorder = void 0;\n        for (var _i = 0; _i < original.length; ++_i) {\n          var a = original[_i];\n          var b = original[_i + 1];\n          if (a && b) {\n            if (!isNaN(a) && !isNaN(b) && parseFloat(a) > parseFloat(b)) {\n              /* istanbul ignore next */\n              disorder = true;\n            } else if (a > b) {\n              disorder = true;\n            }\n            if (disorder) {\n              // To do: right now, I don't say the file\n              // name of the bad sorted item - I have to\n              // figure this out as I join all the files\n              // together beforehand and lose track.\n              disorder = 'sort: -:' + (_i + 2) + ': disorder: ' + b;\n              break;\n            }\n          }\n        }\n        if (disorder) {\n          log(disorder);\n          return;\n        }\n      }\n\n      parts = parts.sort(function (a, b) {\n        var aAlpha = strip(a).replace(/\\W+/g, '');\n        var bAlpha = strip(b).replace(/\\W+/g, '');\n        var aNumeric = strip(a).replace(/\\D/g, '');\n        var bNumeric = strip(b).replace(/\\D/g, '');\n        if (options.humannumericsort) {\n          var aHuman = parseHumanReadableNumbers(strip(a));\n          var bHuman = parseHumanReadableNumbers(strip(b));\n          if (aHuman.group < bHuman.group) {\n            return -1;\n          } else if (aHuman.group > bHuman.group) {\n            return 1;\n          } else if (aHuman.num < bHuman.num) {\n            return -1;\n          } else if (aHuman.num > bHuman.num) {\n            return 1;\n          }\n          return aAlpha.localeCompare(bAlpha);\n        } else if (options.monthsort) {\n          var aMonth = parseMonths(strip(a));\n          var bMonth = parseMonths(strip(b));\n          var result = aMonth - bMonth;\n          if (aMonth === bMonth) {\n            result = aAlpha.localeCompare(bAlpha);\n          }\n          return result;\n        } else if (options.numericsort) {\n          var _result = aNumeric - bNumeric;\n          _result = _result === 0 ? aAlpha.localeCompare(bAlpha) : _result;\n          return _result;\n        }\n        return aAlpha.localeCompare(bAlpha);\n      });\n\n      if (options.randomsort) {\n        parts = shuffle(parts);\n      }\n\n      if (options.reverse) {\n        parts.reverse();\n      }\n\n      var out = parts.join('\\n');\n      if (String(out).trim() !== '') {\n        log(out);\n      }\n\n      return;\n    } catch (e) {\n      /* istanbul ignore next */\n      self.log(e.stack);\n      /* istanbul ignore next */\n      return;\n    }\n  }\n};\n\n// This shit is gnarly.\n// Per the coreutils sort.c:\n// <none/unknown> < K/k < M < G < T < P < E < Z < Y\nvar humanOrdering = { '': 0, 'K': 1, 'k': 1, 'M': 2, 'G': 3, 'T': 4, 'P': 5, 'E': 6, 'Z': 7 };\nvar humanReadableSort = new RegExp(/^([0-9]+)?[\\.]?[0-9]+[K|k|M|G|T|P|E|Z|Y]/g);\nfunction parseHumanReadableNumbers(nbr) {\n  nbr = String(nbr).replace(/(\\r\\n|\\n|\\r)/gm, '');\n  if (String(nbr).match(humanReadableSort)) {\n    var num = parseFloat(String(nbr).replace(/[a-zA-Z]/g, '').trim());\n    var group = humanOrdering[String(nbr).replace(/[^a-zA-Z]/g, '').trim()] || 0;\n    return {\n      num: num,\n      group: group\n    };\n  }\n  var isNumber = String(nbr).match(/^[0-9]/);\n  var stripped = isNumber ? parseFloat(String(nbr).replace(/[^0-9.]/g, '')) : 'NaN';\n  var result = !isNaN(stripped) ? stripped : -99999999999;\n  return {\n    num: result,\n    group: 0\n  };\n}\n\nvar monthOrdering = {\n  jan: 1,\n  feb: 2,\n  mar: 3,\n  apr: 4,\n  may: 5,\n  jun: 6,\n  jul: 7,\n  aug: 8,\n  sep: 9,\n  oct: 10,\n  nov: 11,\n  dec: 12\n};\n\nvar months = new RegExp(/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i);\nfunction parseMonths(str) {\n  var match = String(str).match(months);\n  if (match) {\n    return monthOrdering[String(str.slice(0, 3).toLowerCase())];\n  }\n  return 0;\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return sort;\n  }\n  vorpal.api.sort = sort;\n  vorpal.command('sort [files...]').parse(preparser).option('-M, --month-sort', 'compare (unknown) < \\'JAN\\' < ... < \\'DEC\\'').option('-h, --human-numeric-sort', 'compare human readable numbers (e.g., 2K 1G)').option('-n, --numeric-sort', 'compare according to string numerical value').option('-R, --random-sort', 'sort by random hash of keys').option('-r, --reverse', 'reverse the result of comparisons').option('-c, --check', 'check for sorted input; do not sort').option('-o, --output [file]', 'write result to file instead of standard output').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: sort,\n      args: args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/source.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar fs = require('fs');\n\nvar usage = '-cash: source: filename argument required\\nsource: usage: source filename [arguments]';\n\nvar source = {\n  exec: function exec(args, options) {\n    options = options || {};\n    args = args || {};\n\n    if (typeof args === 'string') {\n      var params = args.split(/\\s+/);\n      args = {};\n      args.file = params[0];\n      if (params.length > 1) {\n        args.params = params.slice(1);\n      }\n    }\n\n    var vorpal = options.vorpal;\n\n    /* istanbul ignore next */\n    if (!vorpal) {\n      throw new Error('Source is not programatically supported.');\n    }\n\n    if (!args.file) {\n      this.log(usage);\n      return 2;\n    }\n    try {\n      // Once support for referencing parameters ($1, $2, etc.) gets added, this\n      // should swap these out with the value of args.params\n      fs.readFileSync(args.file, 'utf8').split('\\n').forEach(function (line) {\n        if (line) {\n          vorpal.execSync(line); // execute each line in the current environment\n        }\n      });\n    } catch (e) {\n      if (e.code === 'ENOENT') {\n        this.log('-cash: ' + args.file + ': No such file or directory');\n      } else if (e.code === 'EACCES') {\n        this.log('-cash: ' + args.file + ': Permission denied');\n      } else if (e.code === 'EISDIR') {\n        this.log('-cash: source: ' + args.file + ': is a directory');\n      } else {\n        /* istanbul ignore next */\n        this.log('-cash: source: unable to read ' + args.file);\n      }\n      return 1;\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return source;\n  }\n  vorpal.api.source = source;\n  vorpal.command('source [file] [params...]').alias('.').parse(preparser).action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: source,\n      args: args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/tail.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar interfacer = require('./../util/interfacer');\nvar expand = require('./../util/expand');\nvar unixPath = require('./../util/converter.path').unix;\n\nvar tail = {\n  exec: function exec(args, options) {\n    options = options || {};\n    var lines = options.lines ? Math.abs(options.lines) : 10;\n    if (!Number.isInteger(lines)) {\n      this.log('tail: ' + options.lines + ': invalid number of lines');\n      return 0;\n    }\n\n    var files = args;\n    files = files === undefined ? [] : files;\n    files = typeof files === 'string' ? String(files).split(' ') : files;\n    files = files.filter(function (file) {\n      return String(file).trim() !== '';\n    });\n    files = expand(files);\n\n    var out = '';\n    for (var i = 0; i < files.length; i++) {\n      var fileFound = false;\n      var isFile = false;\n\n      try {\n        fs.accessSync(files[i], fs.F_OK);\n        fileFound = true;\n      } catch (e) {\n        out += 'tail: cannot open ' + unixPath(files[i]) + ' for reading: No such file or directory\\n';\n      }\n\n      if (fileFound) {\n        isFile = fs.statSync(files[i]).isFile();\n      }\n\n      if (isFile) {\n        var name = unixPath(files[i]);\n        var content = fs.readFileSync(files[i], 'utf8').trim().split('\\n');\n        var verbose = files.length > 1 && !options.silent || options.verbose;\n        if (verbose) {\n          out += '==> ' + name + ' <==\\n';\n        }\n        var sliced = content.slice(content.length - lines, content.length);\n        out += sliced.join('\\n') + '\\n';\n      }\n    }\n\n    out = out.replace(/\\n$/, '');\n    if (out.trim() !== '') {\n      this.log(out);\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return tail;\n  }\n  vorpal.api.tail = tail;\n  vorpal.command('tail [files...]').option('-n, --lines <number>', 'Output the last N lines, instead of the last 10').option('-q, --silent', 'Suppresses printing of headers when multiple files are being examined.').option('-v, --verbose', 'Always output headers giving file names.').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: tail,\n      args: args.files,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/touch.js",
    "content": "'use strict';\n\nvar fs = require('fs-extra');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nrequire('./../lib/sugar');\n\nvar touch = {\n\n  /**\n   * Main command execution.\n   *\n   * @param {Object} args\n   * @return {Object} { status, stdout }\n   * @api public\n   */\n\n  exec: function exec(files, options) {\n    var self = this;\n    files = files || ['.'];\n    files = !Array.isArray(files) ? [files] : files;\n    options = options || {};\n\n    // If any version of --no-create is passed, change it to false.\n    options.create = options.create === true ? false : options.create;\n\n    // If --time is passed, ensure a valid param is called in\n    // and map it to -a or -m, as this is the equivalent of these.\n    // Throw an error if nothing valid passed.\n    if (options.time) {\n      var a = ['access', 'atime', 'use'];\n      var m = ['modify', 'mtime'];\n      var opt = a.indexOf(options.time) > -1 ? 'a' : m.indexOf(options.time) > -1 ? 'm' : undefined;\n      if (!opt) {\n        var error = 'touch: invalid argument \"' + options.time + '\" for \"--time\"\\n' + 'Valid arguments are:\\n' + '  - \"atime\", \"access\", \"use\"\\n' + '  - \"mtime\", \"modify\"\\n' + 'Try \\'touch --help\\' for more information.';\n        // I think this is the stupidest thing\n        // I've ever written.\n        try {\n          throw new Error(error);\n        } catch (e) {\n          return touch.error.call(self, e);\n        }\n      } else {\n        options[opt] = true;\n      }\n    }\n\n    try {\n      var err = false;\n      for (var i = 0; i < files.length; ++i) {\n        try {\n          touch.file(files[i], options);\n        } catch (e) {\n          err = e;\n          break;\n        }\n      }\n      if (err) {\n        return touch.error.call(self, err);\n      }\n      return 0;\n    } catch (e) {\n      return touch.error.call(self, e);\n    }\n  },\n\n\n  /**\n   * Returns touch stderr and response codes\n   * for errors.\n   *\n   * @param {Error} e\n   * @return {Object} { status, stdout }\n   * @api private\n   */\n\n  error: function error(e) {\n    this.log(e.message);\n    return 2;\n  },\n\n\n  /**\n   * Handler for a single file using touch.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @api private\n   */\n\n  file: function file(path, options) {\n    try {\n      try {\n        fs.lstatSync(path);\n      } catch (e) {\n        // If the file doesn't exist and\n        // the user doesn't want to create it,\n        // we have no purpose in life. Goodbye.\n        if (options.create === false) {\n          throw new Error(e);\n        } else {\n          fs.closeSync(fs.openSync(path, 'wx'));\n        }\n      }\n\n      var stat = fs.statSync(path);\n      var dateToSet = options.date ? Date.create(options.date) : new Date();\n\n      if (String(dateToSet) === 'Invalid Date') {\n        throw new Error('touch: invalid date format ' + options.date);\n      }\n\n      // If -m, keep access time current.\n      var atime = options.m === true ? new Date(stat.atime) : dateToSet;\n\n      // If -a, keep mod time to current.\n      var mtime = options.a === true ? new Date(stat.mtime) : dateToSet;\n\n      if (options.reference !== undefined) {\n        var reference = void 0;\n        try {\n          reference = fs.statSync(options.reference);\n        } catch (e) {\n          throw new Error('touch: failed to get attributes of ' + options.reference + ': No such file or directory');\n        }\n        atime = options.m === true ? atime : reference.atime;\n        mtime = options.a === true ? mtime : reference.mtime;\n      }\n\n      fs.utimesSync(path, atime, mtime);\n      fs.utimesSync(path, atime, mtime);\n    } catch (e) {\n      throw new Error(e);\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return touch;\n  }\n  vorpal.api.touch = touch;\n  vorpal.command('touch <files...>').parse(preparser).option('-a', 'change only the access time').option('-c, --no-create', 'do not create any files').option('-d, --date [STRING]', 'parse STRING and use it instead of current time').option('-m', 'change only the modification time').option('-r, --reference [FILE]', 'use this file\\'s times instead of current time').option('--time [WORD]', 'change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    return interfacer.call(this, {\n      command: touch,\n      args: args.files || [],\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/true.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\n\nvar _true = {\n  exec: function exec() {\n    // Always return 0\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _true;\n  }\n  vorpal.api.true = _true;\n  vorpal.command('true').action(function (args, callback) {\n    return interfacer.call(this, {\n      command: _true,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/unalias.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar unalias = {\n  exec: function exec(args, options) {\n    var _this = this;\n\n    args = args;\n    options = options || {};\n    var vorpal = options.vorpal;\n\n    if (!vorpal) {\n      /* istanbul ignore next */\n      throw new Error('Unalias is not programatically supported.');\n    }\n\n    vorpal._aliases = vorpal._aliases || [];\n\n    if (typeof args === 'string' || args instanceof String) {\n      args = String(args).split(' ');\n      args = args.filter(function (str) {\n        return String(str).trim() !== '';\n      });\n    }\n\n    // Validate no input with help.\n    if ((args === undefined || args.length < 1 || args === '') && !options.a) {\n      this.log('unalias: usage: unalias [-a] name [name ...]');\n      return 1;\n    }\n\n    // Pull list of aliases\n    var all = void 0;\n    try {\n      all = JSON.parse(vorpal.localStorage.getItem('aliases') || []);\n    } catch (e) {\n      /* istanbul ignore next */\n      all = [];\n      /* istanbul ignore next */\n      vorpal.localStorage.removeItem('aliases');\n    }\n\n    if (options.a) {\n      args = all;\n    }\n\n    // Remove each alias in the list.\n\n    var _loop = function _loop(i) {\n      var key = args[i];\n      var item = vorpal.localStorage.getItem('alias|' + key);\n      if (item !== undefined && item !== null) {\n        vorpal.localStorage.removeItem('alias|' + key);\n      } else {\n        _this.log('-cash: unalias: ' + key + ': not found');\n      }\n      all = all.filter(function (str) {\n        return !(str === key);\n      });\n    };\n\n    for (var i = 0; i < args.length; ++i) {\n      _loop(i);\n    }\n\n    // Rebuild alias lists.\n    var aliases = {};\n    /* istanbul ignore next */\n    for (var _i = 0; _i < all.length; ++_i) {\n      var item = vorpal.localStorage.getItem('alias|' + all[_i]);\n      if (item !== undefined && item !== null) {\n        aliases[all[_i]] = item;\n      }\n    }\n    vorpal._aliases = aliases;\n\n    vorpal.localStorage.setItem('aliases', JSON.stringify(all));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return unalias;\n  }\n  vorpal.api.unalias = unalias;\n  vorpal.command('unalias [name...]').parse(preparser).option('-a', 'remove all alias definitions').action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: unalias,\n      args: args.name,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/commands/which.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar which = {\n  exec: function exec(args, options) {\n    options = options || {};\n\n    var command = (args instanceof Array ? args : [args]).join(' ');\n    if (command.length <= 0) {\n      return 0;\n    }\n    try {\n      this.log(require('which').sync(command));\n      return 0;\n    } catch (error) {\n      this.log(error);\n      return 1;\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return which;\n  }\n  vorpal.api.which = which;\n\n  vorpal.command('which [command]').parse(preparser).action(function (args, callback) {\n    return interfacer.call(this, {\n      command: which,\n      args: args.command,\n      options: {},\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "dist/delimiter.js",
    "content": "'use strict';\n\nvar os = require('os');\nvar username = require('username');\nvar userHome = require('user-home');\n\nvar isWindows = process.platform === 'win32';\nvar pathConverter = require('./util/converter.path');\n\nmodule.exports = {\n  refresh: function refresh(vorpal, cb) {\n    cb = cb || function () {};\n    username().then(function (username) {\n      var user = username;\n      var host = String(os.hostname()).split('.')[0];\n      var home = pathConverter.unix(userHome);\n      var cwd = pathConverter.unix(process.cwd());\n      cwd = cwd.replace(home, '~');\n      var delimiter = user + '@' + host + ':' + cwd + '$';\n      // If we're on linux-based systems, color\n      // the prompt so we don't get confused.\n      if (!isWindows) {\n        delimiter = '\\u001b[32m' + delimiter + '\\u001b[39m';\n      }\n      vorpal.delimiter(delimiter);\n      cb(null);\n    }).catch(function (err) {\n      return cb(err);\n    });\n  },\n  getHomeDir: function getHomeDir() {\n    return userHome;\n  }\n};"
  },
  {
    "path": "dist/help/alias.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: alias [OPTION] [name[=value] ...]\\nDefine or display aliases.\\n\\nWithout arguments, `alias' prints the list of aliases in the reusable\\nform `alias NAME=VALUE' on standard output.\\n\\nOtherwise, an alias is defined for each NAME whose VALUE is given.\\nA trailing space in VALUE causes the next word to be checked for\\nalias substitution when the alias is expanded.\\n\\n  -p           print all defined aliases in a reusable format\\n      --help   display this help and exit\\n\\nReport alias bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/cat.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: cat [OPTION]... [FILE]...\\nConcatenate FILE(s), or standard input, to standard output.\\n\\n  -A, --show-all           equivalent to -vET\\n  -b, --number-nonblank    number nonempty output lines, overrides -n\\n  -e                       equivalent to -vE\\n  -E, --show-ends          display $ at end of each line\\n  -n, --number             number all output lines\\n  -s, --squeeze-blank      suppress repeated empty output lines\\n  -t                       equivalent to -vT\\n  -T, --show-tabs          display TAB characters as ^I\\n  -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB\\n      --help               display this help and exit\\n\\nWith no FILE, or when FILE is -, read standard input.\\n\\nExamples:\\n  cat f - g  Output f's contents, then standard input, then g's contents.\\n  cat        Copy standard input to standard output.\\n\\nReport cat bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/cd.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: cd [DIR]...\\nChange the cash working directory.\\n\\nChange the current directory to DIR.  The default DIR is the value of the\\nHOME shell variable.\\n\\nReport cd bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/clear.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: clear\\nClear the terminal screen\\n\\n      --help        display this help and exit\\n\\nClear ignores any command-line parameters that may be present.\\n\\nReport clear bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/cp.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: cp [OPTION]... [-T] SOURCE DEST\\n  or:  cp [OPTION]... SOURCE... DIRECTORY\\nCopy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\\n\\n  -f, --force           if an existing destination file cannot be\\n                          opened, remove it and try again (this option\\n                          is ignored when the -n option is also used)\\n  -n, --no-clobber      do not overwrite an existing file (overrides\\n                          a previous -i option)\\n  -R, -r, --recursive   copy directories recursively\\n      --help            display this help and exit\\n\\nReport cp bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/echo.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: echo [OPTION]... [ARG ...]\\nWrite arguments to the standard output.\\n\\nDisplay the ARGs, separated by a single space character and followed by a\\nnewline, on the standard output.\\n\\n  -e           enable interpretation of the following backslash escapes\\n  -e           explicitly suppress interpretation of backslash escapes\\n      --help   display this help and exit\\n\\n  `echo' interprets the following backslash-escaped characters:\\n    \\b         backspace\\n    c         suppress further output\\n    \\n         new line\\n    \\r         carriage return\\n    \\t         horizontal tab\\n    \\\\         backslash\\n\\nReport echo bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/export.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: export [OPTION] [name[=value]]\\nExport variables into the environment\\n\\nWithout arguments, `export' prints the list of environnmental variables in the\\nform `declare -x NAME=\\\"VALUE\\\"' on standard output. This is the same as the\\nbehavior if `-p' is given.\\n\\nOtherwise, the variable is exported to the environment. If the variable has\\nalready been defined in the environment (ex. `PATH'), then this will either\\nredefine its value or do nothing (if no value is passed in). If the variable is\\nnot already in the environment, it will be added with the `VALUE' given\\n(defaults to the empty string).\\n\\n  -p           print all exported variables in a reusable format\\n      --help   display this help and exit\\n\\nReport export bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/false.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: false [OPTION]\\nDo nothing, unsuccessfully\\n\\nThis command simply exits with status 1 (failure).\\n\\n      --help   display this help and exit\\n\\nReport false bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/grep.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: grep [OPTION]... PATTERN [FILE]...\\nSearch for PATTERN in each FILE or standard input.\\nPATTERN is, by default, a basic regular expression (BRE).\\nExample: grep -i 'hello world' menu.h main.c\\n\\niwsvmbnHhqr\\n\\nRegexp selection and interpretation:\\n  -i, --ignore-case         ignore case distinctions\\n  -w, --word-regexp         force PATTERN to match only whole words\\n\\nMiscellaneous:\\n  -s, --no-messages         suppress error messages\\n  -v, --invert-match        select non-matching lines\\n      --help                display this help and exit\\n\\nOutput control:\\n  -n, --line-number         print line number with output lines\\n  -H, --with-filename       print the file name for each match\\n  -h, --no-filename         suppress the file name prefix on output\\n  -q, --quiet, --silent     suppress all normal output\\n  -r, --recursive           like --directories=recurse\\n      --include <FILE_PATTERN>  search only files that match FILE_PATTERN\\n\\nWhen FILE is -, read standard input.  With no FILE, read . if a command-line\\n-r is given, - otherwise.  If fewer than two FILEs are given, assume -h.\\nExit status is 0 if any line is selected, 1 otherwise;\\nif any error occurs and -q is not given, the exit status is 2.\\n\\nReport grep bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/head.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: head [OPTION]... [FILE]...\\nPrint the first 10 lines of each FILE to standard output.\\nWith more than one FILE, precede each with a header giving the file name.\\nWith no FILE, or when FILE is -, read standard input.\\n\\n  -n, --lines <number>        output the last N lines, instead of the last 10\\n  -q, --silent                suppresses printing of headers when multiple files\\n                                are being examined\\n  -v, --verbose               always output headers giving file names\\n      --help                  display this help and exit\\n\\nReport head bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/kill.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: kill [OPTION] pid | jobspec ... or kill -l [sigspec]\\nSend a signal to a job.\\n\\nSend the processes identified by PID or JOBSPEC the signal named by\\nSIGSPEC or SIGNUM.  If neither SIGSPEC nor SIGNUM is present, then\\nSIGTERM is assumed.\\n\\n  -s sig         SIG is a signal name\\n  -n sig         SIG is a signal number\\n  -l [sigspec]   list the signal names; if arguments follow `-l' they\\n                 are assumed to be signal numbers for which names\\n                 should be listed\\n      --help     display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if an invalid option is given or an error occurs.\\n\\nReport kill bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/ls.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: ls [OPTION]... [FILE]...\\nList information about the FILEs (the current directory by default).\\nSort entries alphabetically if none of -tSU nor --sort is specified.\\n\\n  -a, --all                  do not ignore entries starting with .\\n  -A, --almost-all           do not list implied . and ..\\n  -d, --directory            list directory entries instead of contents,\\n                               and do not dereference symbolic links\\n  -f                         do not sort, enable -aU, disable -ls --color\\n  -F, --classify             append indicator (one of */=>@|) to entries\\n  -h, --human-readable       with -l, print sizes in human readable format\\n  -i, --inode                print the index number of each file\\n  -l                         use a long listing format\\n  -q, --hide-control-chars   print ? instead of non graphic characters\\n  -r, --reverse              reverse order while sorting\\n  -R, --recursive            list subdirectories recursively\\n  -S                         sort by file size\\n  -t                         sort by modification time, newest first\\n  -U                         do not sort; list entries in directory order\\n  -w, --width=COLS           assume screen width instead of current value\\n  -x                         list entries by lines instead of by columns\\n  -1                         list one file per line\\n      --help                 display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if minor problems (e.g., cannot access subdirectory),\\n  2   if serious trouble (e.g., cannot access command-line argument).\\n\\nReport ls bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/mkdir.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: mkdir [OPTION]... DIRECTORY...\\nCreate the DIRECTORY(ies), if they do not already exist.\\n\\n  -p, --parents     no error if existing, make parent directories as needed\\n  -v, --verbose     print a message for each created directory\\n      --help        display this help and exit\\n\\nReport mkdir bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/mv.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: mv [OPTION]... [-T] SOURCE DEST\\n  or:  mv [OPTION]... SOURCE... DIRECTORY\\n  or:  mv [OPTION]... -t DIRECTORY SOURCE...\\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\\n\\n  -f, --force                  do not prompt before overwriting\\n  -n, --no-clobber             do not overwrite an existing file\\n      --striptrailingslashes   remove any trailing slashes from each SOURCE\\n                                 argument\\n  -v, --verbose                explain what is being done\\n      --help                   display this help and exit\\n\\nIf you specify -f and -n, only -f takes effect.\\n\\nReport mv bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/pwd.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: pwd [-LP]\\nPrint the name of the current working directory.\\n\\n      --help        display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if an invalid option is given or the current directory\\n      cannot be read.\\n\\nReport pwd bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/rm.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: rm [OPTION]... FILE...\\nRemove (unlink) the FILE(s).\\n\\n  -f, --force           ignore nonexistent files and arguments, never prompt\\n  -r, -R, --recursive   remove directories and their contents recursively\\n      --help            display this help and exit\\n\\nBy default, rm does not remove directories.  Use the --recursive (-r or -R)\\noption to remove each listed directory, too, along with all of its contents.\\n\\nTo remove a file whose name starts with a '-', for example '-foo',\\nuse one of these commands:\\n  rm -- -foo\\n  rm ./-foo\\n\\nNote that if you use rm to remove a file, it might be possible to recover\\nsome of its contents, given sufficient expertise and/or time.\\n\\nReport rm bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/sort.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: sort [OPTION]... [FILE]...\\nWrite sorted concatenation of all FILE(s) to standard output.\\n\\nOrdering options:\\n  -M, --month-sort            compare (unknown) < 'JAN' < ... < 'DEC'\\n  -h, --human-numeric-sort    compare human readable numbers (e.g., 2K 1G)\\n  -n, --numeric-sort          compare according to string numerical value\\n  -R, --random-sort           sort by random hash of keys\\n  -r, --reverse               reverse the result of comparisons\\n\\nOther options:\\n  -c, --check,\\n      --check=diagnose-first  check for sorted input; do not sort\\n  -o, --output=FILE           write result to FILE instead of standard output\\n      --help                  display this help and exit\\n\\nWith no FILE, or when FILE is -, read standard input.\\n\\nReport sort bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/source.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: source FILENAME [ARGUMENTS...]\\n  or:  . FILENAME [ARGUMENTS...]\\nRead and execute commands from the filename argument in the current shell.\\n\\nWhen a script is run using source, it runs within the existing shell and any\\nchange of directory or modified variables or aliases will persist after the\\nscript completes. Scripts may contain any commands that cash supports.\\n\\n      --help   display this help and exit\\n\\nReport source bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/tail.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: tail [OPTION]... [FILE]...\\nDisplay the last part of a file.\\n\\nPrint the last 10 lines of each FILE to standard output. With more\\nthan one FILE, precede each with a header giving the file name.\\n\\n  -n, --lines <number>        output the last N lines, instead of the last 10\\n  -q, --silent                suppresses printing of headers when multiple files\\n                                are being examined\\n  -v, --verbose               always output headers giving file names\\n      --help                  display this help and exit\\n\\nReport tail bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/touch.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: touch [OPTION]... FILE...\\nUpdate the access and modification times of each FILE to the current time.\\n\\nA FILE argument that does not exist is created empty, unless -c is\\nsupplied.\\n\\n  -a                      change only the access time\\n  -c, --no-create         do not create any files\\n  -d, --date <STRING>     parse STRING and use it instead of current time\\n  -m                      change only the modification time\\n  -r, --reference <FILE>  use this file's times instead of current time\\n      --time <WORD>       change the specified time:\\n                            WORD is access, atime, or use: equivalent to -a\\n                            WORD is modify or mtime: equivalent to -m\\n      --help              display this help and exit\\n\\nReport touch bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/true.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: true [OPTION]\\nDo nothing, successfully\\n\\nThis command simply exits with status 0 (success).\\n\\n      --help   display this help and exit\\n\\nReport true bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/unalias.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: unalias [OPTION] name ...\\nRemove each name from the list of defined aliases.\\n\\n  -a           remove all alias definitions\\n      --help   display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if a name is not an existing alias.\\n\\nReport unalias bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help/which.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: which COMMAND\\nLook for COMMAND in $PATH.\\n\\n      --help                   display this help and exit\\n\\nReport which bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "dist/help.js",
    "content": "'use strict';\n\nvar pad = require('./util/pad');\n\nvar commands = ['alias [-p] [name=[value]]', 'cat [-AbeEnstTv] [files ...]', 'cd [dir]', 'clear', 'cp [-fnr] source ... dest', 'echo [-eE] [arg ...]', 'export [-p][id=[value]]', 'false', 'grep [-bHhinqsvw] [-m max] [--silent] [--include pattern] pattern [files ...]', 'head [-nqv] <files ...>', 'kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l', 'less [files ...]', 'ls [-aAdFhilQrRStUwx1] [paths ...]', 'mkdir [-pv] [directories ...]', 'mv [-fnv] source ... dest', 'pwd [files ...]', 'rm [-frR] [files ...]', 'sort [-chMnrR] [-o file] [files ...]', 'source filename [arguments...]', 'tail [options] <files ...>', 'touch [-acm] [-d date] [-r ref] [--time word] file ...', 'true', 'unalias [-a] name [names ...]', 'which [command]'];\n\nfunction chop(str, len) {\n  var res = String(str).slice(0, len - 2);\n  res = res.length === len - 2 ? res + '>' : res;\n  return res;\n}\n\nmodule.exports = function () {\n  var version = require('./../package.json').version;\n  var result = '';\n\n  result += 'Cash, version ' + version + '\\n';\n  result += 'These shell commands are defined internally.  Type `help\\' to see this list.\\n';\n  result += 'Type `help name\\' to find out more about the function `name\\'.\\n';\n  result += 'Use `info cash\\' to find out more about the shell in general.\\n';\n  result += '\\n';\n\n  var half = Math.floor(commands.length / 2);\n  var width = Math.floor((process.stdout.columns - 3) / 2);\n  var lhalf = Math.ceil(commands.length / 2);\n  var padding = commands.length % 2 === 1 ? 1 : 0;\n  for (var i = 0; i < lhalf; ++i) {\n    var colA = pad(chop(commands[i], width), width);\n    var colB = pad(chop(commands[half + i + padding] || '', width), width);\n    var line = i === lhalf - 1 ? '' : '\\n';\n    result += ' ' + colA + ' ' + colB + line;\n  }\n\n  return result;\n};"
  },
  {
    "path": "dist/index.js",
    "content": "'use strict';\n\nvar os = require('os');\nvar Vorpal = require('vorpal');\n\nvar commands = require('./../commands.json');\nvar help = require('./help');\nvar interfacer = require('./util/interfacer');\nvar delimiter = require('./delimiter.js');\nvar path = require('path');\nvar fs = require('fs');\nvar minimist = require('minimist');\n\nvar cmds = void 0;\n\nvar app = {\n\n  commands: commands.commands,\n\n  importedCommands: commands.importedCommands,\n\n  vorpal: new Vorpal(),\n\n  _cwd: process.cwd(),\n\n  _fatal: false,\n\n  export: function _export(str, cbk) {\n    // Is this a tagged template literal?\n    var tmpl = Array.isArray(str) && Array.isArray(str.raw);\n    cbk = tmpl && cbk || function () {};\n    var options = {\n      fatal: app._fatal || false\n    };\n    // Hook stdin, execute the command and\n    // then return it all.\n    var intercept = require('./util/intercept');\n    var out = '';\n    var unhook = intercept(function (str) {\n      out += str + '\\n';\n      return '';\n    });\n    var commands = void 0;\n    if (tmpl) {\n      // Render into a single string, inserting interpolated values.\n      var interpVals = [].concat(Array.prototype.slice.call(arguments)).slice(1);\n      var interpStr = str[0];\n      for (var i = 0, l = interpVals.length; i < l; i++) {\n        /* istanbul ignore next */\n        interpStr += '' + interpVals[i] + str[i + 1];\n      }\n      // Split into lines.  Remove blank lines and comments (start with #)\n      commands = interpStr.split(/\\r\\n|\\r|\\n/).filter(function (command) {\n        return !/^\\s*(?:#|$)/.test(command);\n      });\n    } else {\n      commands = [str];\n    }\n    commands.forEach(function (command) {\n      app.vorpal.execSync(command, options);\n    });\n    unhook();\n    return String(out).replace(/\\n$/, '');\n  },\n  load: function load() {\n    var self = this;\n    self.vorpal.api = {};\n    this.commands.forEach(function (cmd) {\n      if (self.importedCommands.indexOf(cmd) > -1) {\n        return;\n      }\n      try {\n        (function () {\n          var mod = require('./commands/' + cmd + '.js');\n          var help = void 0;\n          try {\n            help = require('./help/' + cmd + '.js');\n            help = String(help).replace(/^\\n|\\n$/g, '');\n          } catch (e) {\n            // .. whatever\n          }\n          self.vorpal.use(mod, {\n            parent: self\n          });\n          var cmdObj = self.vorpal.find(cmd);\n          if (cmdObj && help) {\n            /* istanbul ignore next */\n            cmdObj.help(function (args, cb) {\n              cb(help);\n            });\n          }\n        })();\n      } catch (e) {\n        /* istanbul ignore next */\n        self.vorpal.log('Error loading command ' + cmd + ': ', e);\n      }\n    });\n    this.importedCommands.forEach(function (cmd) {\n      try {\n        var mod = require('vorpal-' + cmd);\n        self.vorpal.use(mod, {\n          parent: self\n        });\n      } catch (e) {\n        /* istanbul ignore next */\n        self.vorpal.log('Error loading command ' + cmd + ': ', e);\n      }\n    });\n\n    // If we're running Windows, register\n    // process spawning for Windows child processes.\n    // If on Linux, just does registers the .catch command.\n    var windows = require('./windows');\n    windows.registerCommands(self);\n\n    var _loop = function _loop(cmd) {\n      if (app.vorpal.api.hasOwnProperty(cmd)) {\n        app.export[cmd] = function (args, options, callback) {\n          callback = callback || function () {};\n          options = options || {};\n          options.vorpal = app.vorpal;\n          return interfacer.call(this, {\n            command: app.vorpal.api[cmd],\n            args: args,\n            options: options,\n            callback: callback,\n            async: app.vorpal.api[cmd].async || false,\n            silent: true\n          });\n        };\n      }\n    };\n\n    for (var cmd in app.vorpal.api) {\n      _loop(cmd);\n    }\n\n    self.vorpal.localEnv = Object.create(process.env);\n    var argv = minimist(process.argv.slice(2));\n\n    /* istanbul ignore next */\n    if (typeof argv.c !== 'undefined' && typeof argv.c !== 'string') {\n      console.error('cash: -c: option requires an argument');\n      process.exit(2);\n    } else if (typeof argv.c === 'string' || argv._.length > 0) {\n      for (var k = 0; k < argv._.length; k++) {\n        self.vorpal.localEnv.k = argv._[k];\n      }\n      // If -c is used, use that string, otherwise use the script-name instead\n      var script = argv.c || 'source ' + argv._[0];\n      app.vorpal.execSync(script);\n      process.exit(0);\n    }\n\n    // Otherwise, start an interactive shell\n    self.vorpal.localEnv[0] = 'cash';\n\n    app.vorpal.history('cash').localStorage('cash').help(help);\n\n    app.vorpal.find('exit').action(function () {\n      /* istanbul ignore next */\n      process.exit();\n    });\n\n    // Load aliases\n    var all = void 0;\n    try {\n      all = JSON.parse(app.vorpal.localStorage.getItem('aliases') || []);\n    } catch (e) {\n      /* istanbul ignore next */\n      all = [];\n      /* istanbul ignore next */\n      app.vorpal.localStorage.removeItem('aliases');\n    }\n    var aliases = {};\n    /* istanbul ignore next */\n    for (var i = 0; i < all.length; ++i) {\n      var item = app.vorpal.localStorage.getItem('alias|' + all[i]);\n      if (item !== undefined && item !== null) {\n        aliases[all[i]] = item;\n      }\n    }\n    app.vorpal._aliases = aliases;\n\n    // Override SIGINT to be ignored,\n    // and if the user is insistent, give\n    // a helpful message. The purpose of this\n    // is to give a full shell feel, not an\n    // application running over the shell.\n    // Skip this on linux, as its mainly\n    // for dev testing.\n    /* istanbul ignore next */\n    if (os.platform().indexOf('win') > -1) {\n      (function () {\n        var counter = 0;\n        setInterval(function () {\n          counter = counter > 0 ? 0 : counter;\n        }, 3000);\n        app.vorpal.sigint(function () {\n          counter++;\n          app.vorpal.ui.submit('');\n          if (counter > 5) {\n            app.vorpal.log('(to quit Cash, use the \"exit\" command)');\n            counter -= 10000;\n          }\n          return;\n        });\n      })();\n    }\n\n    // Load .cashrc upon startup\n    var locations = ['.cashrc'];\n    if (process.platform === 'win32') {\n      /* istanbul ignore next */\n      locations.push('_cashrc');\n    }\n    locations = locations.map(function (str) {\n      return path.join(delimiter.getHomeDir(), str);\n    });\n\n    for (var _i = 0; _i < locations.length; ++_i) {\n      try {\n        /* istanbul ignore if */\n        if (!fs.statSync(locations[_i]).isDirectory()) {\n          app.vorpal.execSync('source ' + locations[_i]);\n          break;\n        }\n      } catch (e) {\n        // File doesn't exist, so just don't load defaults\n      }\n    }\n\n    app.export.vorpal = app.vorpal;\n    Object.assign(app.export, cmds);\n    return this;\n  }\n};\n\ncmds = {\n  /* istanbul ignore next */\n\n  show: function show() {\n    /* istanbul ignore next */\n    app.vorpal.show();\n  }\n};\n\napp.load();\n\nmodule.exports = app.export;"
  },
  {
    "path": "dist/lib/sugar.js",
    "content": "\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n/*\n *  Sugar Library v1.4.1\n *\n *  Freely distributable and licensed under the MIT-style license.\n *  Copyright (c) 2014 Andrew Plummer\n *  http://sugarjs.com/\n *\n * ---------------------------- */\n/* istanbul ignore next */\n(function () {\n  function aa(a) {\n    return function () {\n      return a;\n    };\n  }\n  /* istanbul ignore next */\n  var m = Object,\n      p = Array,\n      q = RegExp,\n      r = Date,\n      s = String,\n      t = Number,\n      u = Math,\n      ba = \"undefined\" !== typeof global ? global : this,\n      v = m.prototype.toString,\n      da = m.prototype.hasOwnProperty,\n      ea = m.defineProperty && m.defineProperties,\n      fa = \"function\" === typeof q(),\n      ga = !(\"0\" in new s(\"a\")),\n      ia = {},\n      ja = /^\\[object Date|Array|String|Number|RegExp|Boolean|Arguments\\]$/,\n      w = \"Boolean Number String Array Date RegExp Function\".split(\" \"),\n      la = ka(\"boolean\", w[0]),\n      y = ka(\"number\", w[1]),\n      z = ka(\"string\", w[2]),\n      A = ma(w[3]),\n      C = ma(w[4]),\n      D = ma(w[5]),\n      F = ma(w[6]);\n  /* istanbul ignore next */\n  function ma(a) {\n    var b = \"Array\" === a && p.isArray || function (b, d) {\n      return (d || v.call(b)) === \"[object \" + a + \"]\";\n    };return ia[a] = b;\n  }function ka(a, b) {\n    function c(c) {\n      return G(c) ? v.call(c) === \"[object \" + b + \"]\" : (typeof c === \"undefined\" ? \"undefined\" : _typeof(c)) === a;\n    }return ia[b] = c;\n  }\n  function na(a) {\n    a.SugarMethods || (oa(a, \"SugarMethods\", {}), H(a, !1, !0, { extend: function extend(b, c, d) {\n        H(a, !1 !== d, c, b);\n      }, sugarRestore: function sugarRestore() {\n        return pa(this, a, arguments, function (a, c, d) {\n          oa(a, c, d.method);\n        });\n      }, sugarRevert: function sugarRevert() {\n        return pa(this, a, arguments, function (a, c, d) {\n          d.existed ? oa(a, c, d.original) : delete a[c];\n        });\n      } }));\n  }function H(a, b, c, d) {\n    var e = b ? a.prototype : a;na(a);I(d, function (d, f) {\n      var h = e[d],\n          l = J(e, d);F(c) && h && (f = qa(h, f, c));!1 === c && h || oa(e, d, f);a.SugarMethods[d] = { method: f, existed: l, original: h, instance: b };\n    });\n  }\n  function K(a, b, c, d, e) {\n    var g = {};d = z(d) ? d.split(\",\") : d;d.forEach(function (a, b) {\n      e(g, a, b);\n    });H(a, b, c, g);\n  }function pa(a, b, c, d) {\n    var e = 0 === c.length,\n        g = L(c),\n        f = !1;I(b.SugarMethods, function (b, c) {\n      if (e || -1 !== g.indexOf(b)) f = !0, d(c.instance ? a.prototype : a, b, c);\n    });return f;\n  }function qa(a, b, c) {\n    return function (d) {\n      return c.apply(this, arguments) ? b.apply(this, arguments) : a.apply(this, arguments);\n    };\n  }function oa(a, b, c) {\n    ea ? m.defineProperty(a, b, { value: c, configurable: !0, enumerable: !1, writable: !0 }) : a[b] = c;\n  }\n  function L(a, b, c) {\n    var d = [];c = c || 0;var e;for (e = a.length; c < e; c++) {\n      d.push(a[c]), b && b.call(a, a[c], c);\n    }return d;\n  }function sa(a, b, c) {\n    var d = a[c || 0];A(d) && (a = d, c = 0);L(a, b, c);\n  }function ta(a) {\n    if (!a || !a.call) throw new TypeError(\"Callback is not callable\");\n  }function M(a) {\n    return void 0 !== a;\n  }function N(a) {\n    return void 0 === a;\n  }function J(a, b) {\n    return !!a && da.call(a, b);\n  }function G(a) {\n    return !!a && (\"object\" === (typeof a === \"undefined\" ? \"undefined\" : _typeof(a)) || fa && D(a));\n  }function ua(a) {\n    var b = typeof a === \"undefined\" ? \"undefined\" : _typeof(a);return null == a || \"string\" === b || \"number\" === b || \"boolean\" === b;\n  }\n  function va(a, b) {\n    b = b || v.call(a);try {\n      if (a && a.constructor && !J(a, \"constructor\") && !J(a.constructor.prototype, \"isPrototypeOf\")) return !1;\n    } catch (c) {\n      return !1;\n    }return !!a && \"[object Object]\" === b && \"hasOwnProperty\" in a;\n  }function I(a, b) {\n    for (var c in a) {\n      if (J(a, c) && !1 === b.call(a, c, a[c], a)) break;\n    }\n  }function wa(a, b) {\n    for (var c = 0; c < a; c++) {\n      b(c);\n    }\n  }function xa(a, b) {\n    I(b, function (c) {\n      a[c] = b[c];\n    });return a;\n  }function ya(a) {\n    ua(a) && (a = m(a));if (ga && z(a)) for (var b = a, c = 0, d; d = b.charAt(c);) {\n      b[c++] = d;\n    }return a;\n  }function O(a) {\n    xa(this, ya(a));\n  }\n  O.prototype.constructor = m;var P = u.abs,\n      za = u.pow,\n      Aa = u.ceil,\n      Q = u.floor,\n      R = u.round,\n      Ca = u.min,\n      S = u.max;function Da(a, b, c) {\n    var d = za(10, P(b || 0));c = c || R;0 > b && (d = 1 / d);return c(a * d) / d;\n  }var Ea = 48,\n      Fa = 57,\n      Ga = 65296,\n      Ha = 65305,\n      Ia = \".\",\n      Ja = \"\",\n      Ka = {},\n      La;function Ma() {\n    return \"\\t\\n\\u000b\\f\\r   ᠎             \\u2028\\u2029　﻿\";\n  }function Na(a, b) {\n    var c = \"\";for (a = a.toString(); 0 < b;) {\n      if (b & 1 && (c += a), b >>= 1) a += a;\n    }return c;\n  }\n  function Oa(a, b) {\n    var c, d;c = a.replace(La, function (a) {\n      a = Ka[a];a === Ia && (d = !0);return a;\n    });return d ? parseFloat(c) : parseInt(c, b || 10);\n  }function T(a, b, c, d) {\n    d = P(a).toString(d || 10);d = Na(\"0\", b - d.replace(/\\.\\d+/, \"\").length) + d;if (c || 0 > a) d = (0 > a ? \"-\" : \"+\") + d;return d;\n  }function Pa(a) {\n    if (11 <= a && 13 >= a) return \"th\";switch (a % 10) {case 1:\n        return \"st\";case 2:\n        return \"nd\";case 3:\n        return \"rd\";default:\n        return \"th\";}\n  }\n  function Qa(a, b) {\n    function c(a, c) {\n      if (a || -1 < b.indexOf(c)) d += c;\n    }var d = \"\";b = b || \"\";c(a.multiline, \"m\");c(a.ignoreCase, \"i\");c(a.global, \"g\");c(a.u, \"y\");return d;\n  }function Ra(a) {\n    z(a) || (a = s(a));return a.replace(/([\\\\/\\'*+?|()\\[\\]{}.^$])/g, \"\\\\$1\");\n  }function U(a, b) {\n    return a[\"get\" + (a._utc ? \"UTC\" : \"\") + b]();\n  }function Sa(a, b, c) {\n    return a[\"set\" + (a._utc && \"ISOWeek\" != b ? \"UTC\" : \"\") + b](c);\n  }\n  function Ta(a, b) {\n    var c = typeof a === \"undefined\" ? \"undefined\" : _typeof(a),\n        d,\n        e,\n        g,\n        f,\n        h,\n        l,\n        n;if (\"string\" === c) return a;g = v.call(a);d = va(a, g);e = A(a, g);if (null != a && d || e) {\n      b || (b = []);if (1 < b.length) for (l = b.length; l--;) {\n        if (b[l] === a) return \"CYC\";\n      }b.push(a);d = a.valueOf() + s(a.constructor);f = e ? a : m.keys(a).sort();l = 0;for (n = f.length; l < n; l++) {\n        h = e ? l : f[l], d += h + Ta(a[h], b);\n      }b.pop();\n    } else d = -Infinity === 1 / a ? \"-0\" : s(a && a.valueOf ? a.valueOf() : a);return c + g + d;\n  }function Ua(a, b) {\n    return a === b ? 0 !== a || 1 / a === 1 / b : Va(a) && Va(b) ? Ta(a) === Ta(b) : !1;\n  }\n  function Va(a) {\n    var b = v.call(a);return ja.test(b) || va(a, b);\n  }function Wa(a, b, c) {\n    var d,\n        e = a.length,\n        g = b.length,\n        f = !1 !== b[g - 1];if (!(g > (f ? 1 : 2))) return Xa(a, e, b[0], f, c);d = [];L(b, function (b) {\n      if (la(b)) return !1;d.push(Xa(a, e, b, f, c));\n    });return d;\n  }function Xa(a, b, c, d, e) {\n    d && (c %= b, 0 > c && (c = b + c));return e ? a.charAt(c) : a[c];\n  }function Ya(a, b) {\n    K(b, !0, !1, a, function (a, b) {\n      a[b + (\"equal\" === b ? \"s\" : \"\")] = function () {\n        return m[b].apply(null, [this].concat(L(arguments)));\n      };\n    });\n  }na(m);I(w, function (a, b) {\n    na(ba[b]);\n  });var Za, $a;\n  for ($a = 0; 9 >= $a; $a++) {\n    Za = s.fromCharCode($a + Ga), Ja += Za, Ka[Za] = s.fromCharCode($a + Ea);\n  }Ka[\",\"] = \"\";Ka[\"．\"] = Ia;Ka[Ia] = Ia;La = q(\"[\" + Ja + \"．,\" + Ia + \"]\", \"g\");\n  \"use strict\";H(m, !1, !1, { keys: function keys(a) {\n      var b = [];if (!G(a) && !D(a) && !F(a)) throw new TypeError(\"Object required\");I(a, function (a) {\n        b.push(a);\n      });return b;\n    } });\n  function ab(a, b, c, d) {\n    var e = a.length,\n        g = -1 == d,\n        f = g ? e - 1 : 0;c = isNaN(c) ? f : parseInt(c >> 0);0 > c && (c = e + c);if (!g && 0 > c || g && c >= e) c = f;for (; g && 0 <= c || !g && c < e;) {\n      if (a[c] === b) return c;c += d;\n    }return -1;\n  }function bb(a, b, c, d) {\n    var e = a.length,\n        g = 0,\n        f = M(c);ta(b);if (0 != e || f) f || (c = a[d ? e - 1 : g], g++);else throw new TypeError(\"Reduce called on empty array with no initial value\");for (; g < e;) {\n      f = d ? e - g - 1 : g, f in a && (c = b(c, a[f], f, a)), g++;\n    }return c;\n  }function cb(a) {\n    if (0 === a.length) throw new TypeError(\"First argument must be defined\");\n  }H(p, !1, !1, { isArray: function isArray(a) {\n      return A(a);\n    } });\n  H(p, !0, !1, { every: function every(a, b) {\n      var c = this.length,\n          d = 0;for (cb(arguments); d < c;) {\n        if (d in this && !a.call(b, this[d], d, this)) return !1;d++;\n      }return !0;\n    }, some: function some(a, b) {\n      var c = this.length,\n          d = 0;for (cb(arguments); d < c;) {\n        if (d in this && a.call(b, this[d], d, this)) return !0;d++;\n      }return !1;\n    }, map: function map(a, b) {\n      b = arguments[1];var c = this.length,\n          d = 0,\n          e = Array(c);for (cb(arguments); d < c;) {\n        d in this && (e[d] = a.call(b, this[d], d, this)), d++;\n      }return e;\n    }, filter: function filter(a) {\n      var b = arguments[1],\n          c = this.length,\n          d = 0,\n          e = [];for (cb(arguments); d < c;) {\n        d in this && a.call(b, this[d], d, this) && e.push(this[d]), d++;\n      }return e;\n    }, indexOf: function indexOf(a, b) {\n      return z(this) ? this.indexOf(a, b) : ab(this, a, b, 1);\n    }, lastIndexOf: function lastIndexOf(a, b) {\n      return z(this) ? this.lastIndexOf(a, b) : ab(this, a, b, -1);\n    }, forEach: function forEach(a, b) {\n      var c = this.length,\n          d = 0;for (ta(a); d < c;) {\n        d in this && a.call(b, this[d], d, this), d++;\n      }\n    }, reduce: function reduce(a, b) {\n      return bb(this, a, b);\n    }, reduceRight: function reduceRight(a, b) {\n      return bb(this, a, b, !0);\n    } });\n  H(Function, !0, !1, { bind: function bind(a) {\n      var b = this,\n          c = L(arguments, null, 1),\n          d;if (!F(this)) throw new TypeError(\"Function.prototype.bind called on a non-function\");d = function d() {\n        return b.apply(b.prototype && this instanceof b ? this : a, c.concat(L(arguments)));\n      };d.prototype = this.prototype;return d;\n    } });H(r, !1, !1, { now: function now() {\n      return new r().getTime();\n    } });\n  (function () {\n    var a = Ma().match(/^\\s+$/);try {\n      s.prototype.trim.call([1]);\n    } catch (b) {\n      a = !1;\n    }H(s, !0, !a, { trim: function trim() {\n        return this.toString().trimLeft().trimRight();\n      }, trimLeft: function trimLeft() {\n        return this.replace(q(\"^[\" + Ma() + \"]+\"), \"\");\n      }, trimRight: function trimRight() {\n        return this.replace(q(\"[\" + Ma() + \"]+$\"), \"\");\n      } });\n  })();\n  (function () {\n    var a = new r(r.UTC(1999, 11, 31)),\n        a = a.toISOString && \"1999-12-31T00:00:00.000Z\" === a.toISOString();K(r, !0, !a, \"toISOString,toJSON\", function (a, c) {\n      a[c] = function () {\n        return T(this.getUTCFullYear(), 4) + \"-\" + T(this.getUTCMonth() + 1, 2) + \"-\" + T(this.getUTCDate(), 2) + \"T\" + T(this.getUTCHours(), 2) + \":\" + T(this.getUTCMinutes(), 2) + \":\" + T(this.getUTCSeconds(), 2) + \".\" + T(this.getUTCMilliseconds(), 3) + \"Z\";\n      };\n    });\n  })();\n  \"use strict\";\n  var W,\n      Ib,\n      Jb = \"ampm hour minute second ampm utc offset_sign offset_hours offset_minutes ampm\".split(\" \"),\n      Kb = \"({t})?\\\\s*(\\\\d{1,2}(?:[,.]\\\\d+)?)(?:{h}([0-5]\\\\d(?:[,.]\\\\d+)?)?{m}(?::?([0-5]\\\\d(?:[,.]\\\\d+)?){s})?\\\\s*(?:({t})|(Z)|(?:([+-])(\\\\d{2,2})(?::?(\\\\d{2,2}))?)?)?|\\\\s*({t}))\",\n      Lb = {},\n      Mb,\n      Nb,\n      Ob,\n      Pb = [],\n      Qb = {},\n      X = { yyyy: function yyyy(a) {\n      return U(a, \"FullYear\");\n    }, yy: function yy(a) {\n      return U(a, \"FullYear\") % 100;\n    }, ord: function ord(a) {\n      a = U(a, \"Date\");return a + Pa(a);\n    }, tz: function tz(a) {\n      return a.getUTCOffset();\n    }, isotz: function isotz(a) {\n      return a.getUTCOffset(!0);\n    },\n    Z: function Z(a) {\n      return a.getUTCOffset();\n    }, ZZ: function ZZ(a) {\n      return a.getUTCOffset().replace(/(\\d{2})$/, \":$1\");\n    } },\n      Rb = [{ name: \"year\", method: \"FullYear\", k: !0, b: function b(a) {\n      return 864E5 * (365 + (a ? a.isLeapYear() ? 1 : 0 : 0.25));\n    } }, { name: \"month\", error: 0.919, method: \"Month\", k: !0, b: function b(a, _b) {\n      var c = 30.4375,\n          d;a && (d = a.daysInMonth(), _b <= d.days() && (c = d));return 864E5 * c;\n    } }, { name: \"week\", method: \"ISOWeek\", b: aa(6048E5) }, { name: \"day\", error: 0.958, method: \"Date\", k: !0, b: aa(864E5) }, { name: \"hour\", method: \"Hours\", b: aa(36E5) }, { name: \"minute\",\n    method: \"Minutes\", b: aa(6E4) }, { name: \"second\", method: \"Seconds\", b: aa(1E3) }, { name: \"millisecond\", method: \"Milliseconds\", b: aa(1) }],\n      Sb = {};function Tb(a) {\n    xa(this, a);this.g = Pb.concat();\n  }\n  Tb.prototype = { getMonth: function getMonth(a) {\n      return y(a) ? a - 1 : this.months.indexOf(a) % 12;\n    }, getWeekday: function getWeekday(a) {\n      return this.weekdays.indexOf(a) % 7;\n    }, addFormat: function addFormat(a, b, c, d, e) {\n      var g = c || [],\n          f = this,\n          h;a = a.replace(/\\s+/g, \"[,. ]*\");a = a.replace(/\\{([^,]+?)\\}/g, function (a, b) {\n        var d,\n            e,\n            h,\n            B = b.match(/\\?$/);h = b.match(/^(\\d+)\\??$/);var k = b.match(/(\\d)(?:-(\\d))?/),\n            E = b.replace(/[^a-z]+$/, \"\");h ? d = f.tokens[h[1]] : f[E] ? d = f[E] : f[E + \"s\"] && (d = f[E + \"s\"], k && (e = [], d.forEach(function (a, b) {\n          var c = b % (f.units ? 8 : d.length);c >= k[1] && c <= (k[2] || k[1]) && e.push(a);\n        }), d = e), d = Ub(d));h ? h = \"(?:\" + d + \")\" : (c || g.push(E), h = \"(\" + d + \")\");B && (h += \"?\");return h;\n      });b ? (b = Vb(f, e), e = [\"t\", \"[\\\\s\\\\u3000]\"].concat(f.timeMarker), h = a.match(/\\\\d\\{\\d,\\d\\}\\)+\\??$/), Wb(f, \"(?:\" + b + \")[,\\\\s\\\\u3000]+?\" + a, Jb.concat(g), d), Wb(f, a + \"(?:[,\\\\s]*(?:\" + e.join(\"|\") + (h ? \"+\" : \"*\") + \")\" + b + \")?\", g.concat(Jb), d)) : Wb(f, a, g, d);\n    } };\n  function Xb(a, b, c) {\n    var d,\n        e,\n        g = b[0],\n        f = b[1],\n        h = b[2];b = a[c] || a.relative;if (F(b)) return b.call(a, g, f, h, c);e = a.units[8 * (a.plural && 1 < g ? 1 : 0) + f] || a.units[f];a.capitalizeUnit && (e = Yb(e));d = a.modifiers.filter(function (a) {\n      return \"sign\" == a.name && a.value == (0 < h ? 1 : -1);\n    })[0];return b.replace(/\\{(.*?)\\}/g, function (a, b) {\n      switch (b) {case \"num\":\n          return g;case \"unit\":\n          return e;case \"sign\":\n          return d.src;}\n    });\n  }function Zb(a, b) {\n    b = b || a.code;return \"en\" === b || \"en-US\" === b ? !0 : a.variant;\n  }\n  function $b(a, b) {\n    return b.replace(q(a.num, \"g\"), function (b) {\n      return ac(a, b) || \"\";\n    });\n  }function ac(a, b) {\n    var c;return y(b) ? b : b && -1 !== (c = a.numbers.indexOf(b)) ? (c + 1) % 10 : 1;\n  }function Y(a, b) {\n    var c;z(a) || (a = \"\");c = Sb[a] || Sb[a.slice(0, 2)];if (!1 === b && !c) throw new TypeError(\"Invalid locale.\");return c || Ib;\n  }\n  function bc(a, b) {\n    function c(a) {\n      var b = h[a];z(b) ? h[a] = b.split(\",\") : b || (h[a] = []);\n    }function d(a, b) {\n      a = a.split(\"+\").map(function (a) {\n        return a.replace(/(.+):(.+)$/, function (a, b, c) {\n          return c.split(\"|\").map(function (a) {\n            return b + a;\n          }).join(\"|\");\n        });\n      }).join(\"|\");a.split(\"|\").forEach(b);\n    }function e(a, b, c) {\n      var e = [];h[a].forEach(function (a, f) {\n        b && (a += \"+\" + a.slice(0, 3));d(a, function (a, b) {\n          e[b * c + f] = a.toLowerCase();\n        });\n      });h[a] = e;\n    }function g(a, b, c) {\n      a = \"\\\\d{\" + a + \",\" + b + \"}\";c && (a += \"|(?:\" + Ub(h.numbers) + \")+\");return a;\n    }function f(a, b) {\n      h[a] = h[a] || b;\n    }var h, l;h = new Tb(b);c(\"modifiers\");\"months weekdays units numbers articles tokens timeMarker ampm timeSuffixes dateParse timeParse\".split(\" \").forEach(c);l = !h.monthSuffix;e(\"months\", l, 12);e(\"weekdays\", l, 7);e(\"units\", !1, 8);e(\"numbers\", !1, 10);f(\"code\", a);f(\"date\", g(1, 2, h.digitDate));f(\"year\", \"'\\\\d{2}|\" + g(4, 4));f(\"num\", function () {\n      var a = [\"-?\\\\d+\"].concat(h.articles);h.numbers && (a = a.concat(h.numbers));return Ub(a);\n    }());(function () {\n      var a = [];h.i = {};h.modifiers.push({ name: \"day\", src: \"yesterday\", value: -1 });\n      h.modifiers.push({ name: \"day\", src: \"today\", value: 0 });h.modifiers.push({ name: \"day\", src: \"tomorrow\", value: 1 });h.modifiers.forEach(function (b) {\n        var c = b.name;d(b.src, function (d) {\n          var e = h[c];h.i[d] = b;a.push({ name: c, src: d, value: b.value });h[c] = e ? e + \"|\" + d : d;\n        });\n      });h.day += \"|\" + Ub(h.weekdays);h.modifiers = a;\n    })();h.monthSuffix && (h.month = g(1, 2), h.months = \"1 2 3 4 5 6 7 8 9 10 11 12\".split(\" \").map(function (a) {\n      return a + h.monthSuffix;\n    }));h.full_month = g(1, 2) + \"|\" + Ub(h.months);0 < h.timeSuffixes.length && h.addFormat(Vb(h), !1, Jb);\n    h.addFormat(\"{day}\", !0);h.addFormat(\"{month}\" + (h.monthSuffix || \"\"));h.addFormat(\"{year}\" + (h.yearSuffix || \"\"));h.timeParse.forEach(function (a) {\n      h.addFormat(a, !0);\n    });h.dateParse.forEach(function (a) {\n      h.addFormat(a);\n    });return Sb[a] = h;\n  }function Wb(a, b, c, d) {\n    a.g.unshift({ r: d, locale: a, q: q(\"^\" + b + \"$\", \"i\"), to: c });\n  }function Yb(a) {\n    return a.slice(0, 1).toUpperCase() + a.slice(1);\n  }function Ub(a) {\n    return a.filter(function (a) {\n      return !!a;\n    }).join(\"|\");\n  }function cc() {\n    var a = r.SugarNewDate;return a ? a() : new r();\n  }\n  function dc(a, b) {\n    var c;if (G(a[0])) return a;if (y(a[0]) && !y(a[1])) return [a[0]];if (z(a[0]) && b) return [ec(a[0]), a[1]];c = {};Nb.forEach(function (b, e) {\n      c[b.name] = a[e];\n    });return [c];\n  }function ec(a) {\n    var b,\n        c = {};if (a = a.match(/^(\\d+)?\\s?(\\w+?)s?$/i)) N(b) && (b = parseInt(a[1]) || 1), c[a[2].toLowerCase()] = b;return c;\n  }function fc(a, b, c) {\n    var d;N(c) && (c = Ob.length);for (b = b || 0; b < c && (d = Ob[b], !1 !== a(d.name, d, b)); b++) {}\n  }\n  function gc(a, b) {\n    var c = {},\n        d,\n        e;b.forEach(function (b, f) {\n      d = a[f + 1];N(d) || \"\" === d || (\"year\" === b && (c.t = d.replace(/'/, \"\")), e = parseFloat(d.replace(/'/, \"\").replace(/,/, \".\")), c[b] = isNaN(e) ? d.toLowerCase() : e);\n    });return c;\n  }function hc(a) {\n    a = a.trim().replace(/^just (?=now)|\\.+$/i, \"\");return ic(a);\n  }\n  function ic(a) {\n    return a.replace(Mb, function (a, c, d) {\n      var e = 0,\n          g = 1,\n          f,\n          h;if (c) return a;d.split(\"\").reverse().forEach(function (a) {\n        a = Lb[a];var b = 9 < a;b ? (f && (e += g), g *= a / (h || 1), h = a) : (!1 === f && (g *= 10), e += g * a);f = b;\n      });f && (e += g);return e;\n    });\n  }\n  function jc(a, b, c, d) {\n    function e(a) {\n      vb.push(a);\n    }function g() {\n      vb.forEach(function (a) {\n        a.call();\n      });\n    }function f() {\n      var a = n.getWeekday();n.setWeekday(7 * (k.num - 1) + (a > Ba ? Ba + 7 : Ba));\n    }function h() {\n      var a = B.i[k.edge];fc(function (a) {\n        if (M(k[a])) return E = a, !1;\n      }, 4);if (\"year\" === E) k.e = \"month\";else if (\"month\" === E || \"week\" === E) k.e = \"day\";n[(0 > a.value ? \"endOf\" : \"beginningOf\") + Yb(E)]();-2 === a.value && n.reset();\n    }function l() {\n      var a;fc(function (b, c, d) {\n        \"day\" === b && (b = \"date\");if (M(k[b])) {\n          if (d >= wb) return n.setTime(NaN), !1;a = a || {};a[b] = k[b];\n          delete k[b];\n        }\n      });a && e(function () {\n        n.set(a, !0);\n      });\n    }var n, x, ha, vb, B, k, E, wb, Ba, ra, ca;n = cc();vb = [];n.utc(d);C(a) ? n.utc(a.isUTC()).setTime(a.getTime()) : y(a) ? n.setTime(a) : G(a) ? (n.set(a, !0), k = a) : z(a) && (ha = Y(b), a = hc(a), ha && I(ha.o ? [ha.o].concat(ha.g) : ha.g, function (c, d) {\n      var g = a.match(d.q);if (g) {\n        B = d.locale;k = gc(g, d.to);B.o = d;k.utc && n.utc();if (k.timestamp) return k = k.timestamp, !1;d.r && !z(k.month) && (z(k.date) || Zb(ha, b)) && (ca = k.month, k.month = k.date, k.date = ca);k.year && 2 === k.t.length && (k.year = 100 * R(U(cc(), \"FullYear\") / 100) - 100 * R(k.year / 100) + k.year);k.month && (k.month = B.getMonth(k.month), k.shift && !k.unit && (k.unit = B.units[7]));k.weekday && k.date ? delete k.weekday : k.weekday && (k.weekday = B.getWeekday(k.weekday), k.shift && !k.unit && (k.unit = B.units[5]));k.day && (ca = B.i[k.day]) ? (k.day = ca.value, n.reset(), x = !0) : k.day && -1 < (Ba = B.getWeekday(k.day)) && (delete k.day, k.num && k.month ? (e(f), k.day = 1) : k.weekday = Ba);k.date && !y(k.date) && (k.date = $b(B, k.date));k.ampm && k.ampm === B.ampm[1] && 12 > k.hour ? k.hour += 12 : k.ampm === B.ampm[0] && 12 === k.hour && (k.hour = 0);if (\"offset_hours\" in k || \"offset_minutes\" in k) n.utc(), k.offset_minutes = k.offset_minutes || 0, k.offset_minutes += 60 * k.offset_hours, \"-\" === k.offset_sign && (k.offset_minutes *= -1), k.minute -= k.offset_minutes;k.unit && (x = !0, ra = ac(B, k.num), wb = B.units.indexOf(k.unit) % 8, E = W.units[wb], l(), k.shift && (ra *= (ca = B.i[k.shift]) ? ca.value : 0), k.sign && (ca = B.i[k.sign]) && (ra *= ca.value), M(k.weekday) && (n.set({ weekday: k.weekday }, !0), delete k.weekday), k[E] = (k[E] || 0) + ra);k.edge && e(h);\"-\" === k.year_sign && (k.year *= -1);fc(function (a, b, c) {\n          b = k[a];var d = b % 1;d && (k[Ob[c - 1].name] = R(d * (\"second\" === a ? 1E3 : 60)), k[a] = Q(b));\n        }, 1, 4);return !1;\n      }\n    }), k ? x ? n.advance(k) : (n._utc && n.reset(), kc(n, k, !0, !1, c)) : (\"now\" !== a && (n = new r(a)), d && n.addMinutes(-n.getTimezoneOffset())), g(), n.utc(!1));return { c: n, set: k };\n  }function lc(a) {\n    var b,\n        c = P(a),\n        d = c,\n        e = 0;fc(function (a, f, h) {\n      b = Q(Da(c / f.b(), 1));1 <= b && (d = b, e = h);\n    }, 1);return [d, e, a];\n  }\n  function mc(a) {\n    var b = lc(a.millisecondsFromNow());if (6 === b[1] || 5 === b[1] && 4 === b[0] && a.daysFromNow() >= cc().daysInMonth()) b[0] = P(a.monthsFromNow()), b[1] = 6;return b;\n  }function nc(a, b, c) {\n    function d(a, c) {\n      var d = U(a, \"Month\");return Y(c).months[d + 12 * b];\n    }Z(a, d, c);Z(Yb(a), d, c, 1);\n  }function Z(a, b, c, d) {\n    X[a] = function (a, g) {\n      var f = b(a, g);c && (f = f.slice(0, c));d && (f = f.slice(0, d).toUpperCase() + f.slice(d));return f;\n    };\n  }\n  function oc(a, b, c) {\n    X[a] = b;X[a + a] = function (a, c) {\n      return T(b(a, c), 2);\n    };c && (X[a + a + a] = function (a, c) {\n      return T(b(a, c), 3);\n    }, X[a + a + a + a] = function (a, c) {\n      return T(b(a, c), 4);\n    });\n  }function pc(a) {\n    var b = a.match(/(\\{\\w+\\})|[^{}]+/g);Qb[a] = b.map(function (a) {\n      a.replace(/\\{(\\w+)\\}/, function (b, e) {\n        a = X[e] || e;return e;\n      });return a;\n    });\n  }\n  function qc(a, b, c, d) {\n    var e;if (!a.isValid()) return \"Invalid Date\";Date[b] ? b = Date[b] : F(b) && (e = mc(a), b = b.apply(a, e.concat(Y(d))));if (!b && c) return e = e || mc(a), 0 === e[1] && (e[1] = 1, e[0] = 1), a = Y(d), Xb(a, e, 0 < e[2] ? \"future\" : \"past\");b = b || \"long\";if (\"short\" === b || \"long\" === b || \"full\" === b) b = Y(d)[b];Qb[b] || pc(b);var g, f;e = \"\";b = Qb[b];g = 0;for (c = b.length; g < c; g++) {\n      f = b[g], e += F(f) ? f(a, d) : f;\n    }return e;\n  }\n  function rc(a, b, c, d, e) {\n    var g,\n        f,\n        h,\n        l = 0,\n        n = 0,\n        x = 0;g = jc(b, c, null, e);0 < d && (n = x = d, f = !0);if (!g.c.isValid()) return !1;if (g.set && g.set.e) {\n      Rb.forEach(function (b) {\n        b.name === g.set.e && (l = b.b(g.c, a - g.c) - 1);\n      });b = Yb(g.set.e);if (g.set.edge || g.set.shift) g.c[\"beginningOf\" + b]();\"month\" === g.set.e && (h = g.c.clone()[\"endOf\" + b]().getTime());!f && g.set.sign && \"millisecond\" != g.set.e && (n = 50, x = -50);\n    }f = a.getTime();b = g.c.getTime();h = sc(a, b, h || b + l);return f >= b - n && f <= h + x;\n  }\n  function sc(a, b, c) {\n    b = new r(b);a = new r(c).utc(a.isUTC());23 !== U(a, \"Hours\") && (b = b.getTimezoneOffset(), a = a.getTimezoneOffset(), b !== a && (c += (a - b).minutes()));return c;\n  }\n  function kc(a, b, c, d, e) {\n    function g(a) {\n      return M(b[a]) ? b[a] : b[a + \"s\"];\n    }function f(a) {\n      return M(g(a));\n    }var h;if (y(b) && d) b = { milliseconds: b };else if (y(b)) return a.setTime(b), a;M(b.date) && (b.day = b.date);fc(function (d, e, g) {\n      var l = \"day\" === d;if (f(d) || l && f(\"weekday\")) return b.e = d, h = +g, !1;!c || \"week\" === d || l && f(\"week\") || Sa(a, e.method, l ? 1 : 0);\n    });Rb.forEach(function (c) {\n      var e = c.name;c = c.method;var h;h = g(e);N(h) || (d ? (\"week\" === e && (h = (b.day || 0) + 7 * h, c = \"Date\"), h = h * d + U(a, c)) : \"month\" === e && f(\"day\") && Sa(a, \"Date\", 15), Sa(a, c, h), d && \"month\" === e && (e = h, 0 > e && (e = e % 12 + 12), e % 12 != U(a, \"Month\") && Sa(a, \"Date\", 0)));\n    });d || f(\"day\") || !f(\"weekday\") || a.setWeekday(g(\"weekday\"));var l;a: {\n      switch (e) {case -1:\n          l = a > cc();break a;case 1:\n          l = a < cc();break a;}l = void 0;\n    }l && fc(function (b, c) {\n      if ((c.k || \"week\" === b && f(\"weekday\")) && !(f(b) || \"day\" === b && f(\"weekday\"))) return a[c.j](e), !1;\n    }, h + 1);return a;\n  }\n  function Vb(a, b) {\n    var c = Kb,\n        d = { h: 0, m: 1, s: 2 },\n        e;a = a || W;return c.replace(/{([a-z])}/g, function (c, f) {\n      var h = [],\n          l = \"h\" === f,\n          n = l && !b;if (\"t\" === f) return a.ampm.join(\"|\");l && h.push(\":\");(e = a.timeSuffixes[d[f]]) && h.push(e + \"\\\\s*\");return 0 === h.length ? \"\" : \"(?:\" + h.join(\"|\") + \")\" + (n ? \"\" : \"?\");\n    });\n  }function tc(a, b, c) {\n    var d, e;y(a[1]) ? d = dc(a)[0] : (d = a[0], e = a[1]);return jc(d, e, b, c).c;\n  }\n  H(r, !1, !0, { create: function create() {\n      return tc(arguments);\n    }, past: function past() {\n      return tc(arguments, -1);\n    }, future: function future() {\n      return tc(arguments, 1);\n    }, addLocale: function addLocale(a, b) {\n      return bc(a, b);\n    }, setLocale: function setLocale(a) {\n      var b = Y(a, !1);Ib = b;a && a != b.code && (b.code = a);return b;\n    }, getLocale: function getLocale(a) {\n      return a ? Y(a, !1) : Ib;\n    }, addFormat: function addFormat(a, b, c) {\n      Wb(Y(c), a, b);\n    } });\n  H(r, !0, !0, { set: function set() {\n      var a = dc(arguments);return kc(this, a[0], a[1]);\n    }, setWeekday: function setWeekday(a) {\n      if (!N(a)) return Sa(this, \"Date\", U(this, \"Date\") + a - U(this, \"Day\"));\n    }, setISOWeek: function setISOWeek(a) {\n      var b = U(this, \"Day\") || 7;if (!N(a)) return this.set({ month: 0, date: 4 }), this.set({ weekday: 1 }), 1 < a && this.addWeeks(a - 1), 1 !== b && this.advance({ days: b - 1 }), this.getTime();\n    }, getISOWeek: function getISOWeek() {\n      var a;a = this.clone();var b = U(a, \"Day\") || 7;a.addDays(4 - b).reset();return 1 + Q(a.daysSince(a.clone().beginningOfYear()) / 7);\n    }, beginningOfISOWeek: function beginningOfISOWeek() {\n      var a = this.getDay();0 === a ? a = -6 : 1 !== a && (a = 1);this.setWeekday(a);return this.reset();\n    }, endOfISOWeek: function endOfISOWeek() {\n      0 !== this.getDay() && this.setWeekday(7);return this.endOfDay();\n    }, getUTCOffset: function getUTCOffset(a) {\n      var b = this._utc ? 0 : this.getTimezoneOffset(),\n          c = !0 === a ? \":\" : \"\";return !b && a ? \"Z\" : T(Q(-b / 60), 2, !0) + c + T(P(b % 60), 2);\n    }, utc: function utc(a) {\n      oa(this, \"_utc\", !0 === a || 0 === arguments.length);return this;\n    }, isUTC: function isUTC() {\n      return !!this._utc || 0 === this.getTimezoneOffset();\n    }, advance: function advance() {\n      var a = dc(arguments, !0);return kc(this, a[0], a[1], 1);\n    }, rewind: function rewind() {\n      var a = dc(arguments, !0);return kc(this, a[0], a[1], -1);\n    }, isValid: function isValid() {\n      return !isNaN(this.getTime());\n    }, isAfter: function isAfter(a, b) {\n      return this.getTime() > r.create(a).getTime() - (b || 0);\n    }, isBefore: function isBefore(a, b) {\n      return this.getTime() < r.create(a).getTime() + (b || 0);\n    }, isBetween: function isBetween(a, b, c) {\n      var d = this.getTime();a = r.create(a).getTime();var e = r.create(b).getTime();b = Ca(a, e);a = S(a, e);c = c || 0;return b - c < d && a + c > d;\n    }, isLeapYear: function isLeapYear() {\n      var a = U(this, \"FullYear\");return 0 === a % 4 && 0 !== a % 100 || 0 === a % 400;\n    },\n    daysInMonth: function daysInMonth() {\n      return 32 - U(new r(U(this, \"FullYear\"), U(this, \"Month\"), 32), \"Date\");\n    }, format: function format(a, b) {\n      return qc(this, a, !1, b);\n    }, relative: function relative(a, b) {\n      z(a) && (b = a, a = null);return qc(this, a, !0, b);\n    }, is: function is(a, b, c) {\n      var d, e;if (this.isValid()) {\n        if (z(a)) switch (a = a.trim().toLowerCase(), e = this.clone().utc(c), !0) {case \"future\" === a:\n            return this.getTime() > cc().getTime();case \"past\" === a:\n            return this.getTime() < cc().getTime();case \"weekday\" === a:\n            return 0 < U(e, \"Day\") && 6 > U(e, \"Day\");case \"weekend\" === a:\n            return 0 === U(e, \"Day\") || 6 === U(e, \"Day\");case -1 < (d = W.weekdays.indexOf(a) % 7):\n            return U(e, \"Day\") === d;case -1 < (d = W.months.indexOf(a) % 12):\n            return U(e, \"Month\") === d;}return rc(this, a, null, b, c);\n      }\n    }, reset: function reset(a) {\n      var b = {},\n          c;a = a || \"hours\";\"date\" === a && (a = \"days\");c = Rb.some(function (b) {\n        return a === b.name || a === b.name + \"s\";\n      });b[a] = a.match(/^days?/) ? 1 : 0;return c ? this.set(b, !0) : this;\n    }, clone: function clone() {\n      var a = new r(this.getTime());a.utc(!!this._utc);return a;\n    } });\n  H(r, !0, !0, { iso: function iso() {\n      return this.toISOString();\n    }, getWeekday: r.prototype.getDay, getUTCWeekday: r.prototype.getUTCDay });function uc(a, b) {\n    function c() {\n      return R(this * b);\n    }function d() {\n      return tc(arguments)[a.j](this);\n    }function e() {\n      return tc(arguments)[a.j](-this);\n    }var g = a.name,\n        f = {};f[g] = c;f[g + \"s\"] = c;f[g + \"Before\"] = e;f[g + \"sBefore\"] = e;f[g + \"Ago\"] = e;f[g + \"sAgo\"] = e;f[g + \"After\"] = d;f[g + \"sAfter\"] = d;f[g + \"FromNow\"] = d;f[g + \"sFromNow\"] = d;t.extend(f);\n  }H(t, !0, !0, { duration: function duration(a) {\n      a = Y(a);return Xb(a, lc(this), \"duration\");\n    } });\n  W = Ib = r.addLocale(\"en\", { plural: !0, timeMarker: \"at\", ampm: \"am,pm\", months: \"January,February,March,April,May,June,July,August,September,October,November,December\", weekdays: \"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\", units: \"millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s\", numbers: \"one,two,three,four,five,six,seven,eight,nine,ten\", articles: \"a,an,the\", tokens: \"the,st|nd|rd|th,of\", \"short\": \"{Month} {d}, {yyyy}\", \"long\": \"{Month} {d}, {yyyy} {h}:{mm}{tt}\", full: \"{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}\",\n    past: \"{num} {unit} {sign}\", future: \"{num} {unit} {sign}\", duration: \"{num} {unit}\", modifiers: [{ name: \"sign\", src: \"ago|before\", value: -1 }, { name: \"sign\", src: \"from now|after|from|in|later\", value: 1 }, { name: \"edge\", src: \"last day\", value: -2 }, { name: \"edge\", src: \"end\", value: -1 }, { name: \"edge\", src: \"first day|beginning\", value: 1 }, { name: \"shift\", src: \"last\", value: -1 }, { name: \"shift\", src: \"the|this\", value: 0 }, { name: \"shift\", src: \"next\", value: 1 }], dateParse: [\"{month} {year}\", \"{shift} {unit=5-7}\", \"{0?} {date}{1}\", \"{0?} {edge} of {shift?} {unit=4-7?}{month?}{year?}\"],\n    timeParse: \"{num} {unit} {sign};{sign} {num} {unit};{0} {num}{1} {day} of {month} {year?};{weekday?} {month} {date}{1?} {year?};{date} {month} {year};{date} {month};{shift} {weekday};{shift} week {weekday};{weekday} {2?} {shift} week;{num} {unit=4-5} {sign} {day};{0?} {date}{1} of {month};{0?}{month?} {date?}{1?} of {shift} {unit=6-7}\".split(\";\") });Ob = Rb.concat().reverse();Nb = Rb.concat();Nb.splice(2, 1);\n  K(r, !0, !0, Rb, function (a, b, c) {\n    function d(a) {\n      a /= f;var c = a % 1,\n          d = b.error || 0.999;c && P(c % 1) > d && (a = R(a));return 0 > a ? Aa(a) : Q(a);\n    }var e = b.name,\n        g = Yb(e),\n        f = b.b(),\n        h,\n        l;b.j = \"add\" + g + \"s\";h = function h(a, b) {\n      return d(this.getTime() - r.create(a, b).getTime());\n    };l = function l(a, b) {\n      return d(r.create(a, b).getTime() - this.getTime());\n    };a[e + \"sAgo\"] = l;a[e + \"sUntil\"] = l;a[e + \"sSince\"] = h;a[e + \"sFromNow\"] = h;a[b.j] = function (a, b) {\n      var c = {};c[e] = a;return this.advance(c, b);\n    };uc(b, f);3 > c && [\"Last\", \"This\", \"Next\"].forEach(function (b) {\n      a[\"is\" + b + g] = function () {\n        return rc(this, b + \" \" + e, \"en\");\n      };\n    });4 > c && (a[\"beginningOf\" + g] = function () {\n      var a = {};switch (e) {case \"year\":\n          a.year = U(this, \"FullYear\");break;case \"month\":\n          a.month = U(this, \"Month\");break;case \"day\":\n          a.day = U(this, \"Date\");break;case \"week\":\n          a.weekday = 0;}return this.set(a, !0);\n    }, a[\"endOf\" + g] = function () {\n      var a = { hours: 23, minutes: 59, seconds: 59, milliseconds: 999 };switch (e) {case \"year\":\n          a.month = 11;a.day = 31;break;case \"month\":\n          a.day = this.daysInMonth();break;case \"week\":\n          a.weekday = 6;}return this.set(a, !0);\n    });\n  });\n  W.addFormat(\"([+-])?(\\\\d{4,4})[-.]?{full_month}[-.]?(\\\\d{1,2})?\", !0, [\"year_sign\", \"year\", \"month\", \"date\"], !1, !0);W.addFormat(\"(\\\\d{1,2})[-.\\\\/]{full_month}(?:[-.\\\\/](\\\\d{2,4}))?\", !0, [\"date\", \"month\", \"year\"], !0);W.addFormat(\"{full_month}[-.](\\\\d{4,4})\", !1, [\"month\", \"year\"]);W.addFormat(\"\\\\/Date\\\\((\\\\d+(?:[+-]\\\\d{4,4})?)\\\\)\\\\/\", !1, [\"timestamp\"]);W.addFormat(Vb(W), !1, Jb);Pb = W.g.slice(0, 7).reverse();W.g = W.g.slice(7).concat(Pb);oc(\"f\", function (a) {\n    return U(a, \"Milliseconds\");\n  }, !0);\n  oc(\"s\", function (a) {\n    return U(a, \"Seconds\");\n  });oc(\"m\", function (a) {\n    return U(a, \"Minutes\");\n  });oc(\"h\", function (a) {\n    return U(a, \"Hours\") % 12 || 12;\n  });oc(\"H\", function (a) {\n    return U(a, \"Hours\");\n  });oc(\"d\", function (a) {\n    return U(a, \"Date\");\n  });oc(\"M\", function (a) {\n    return U(a, \"Month\") + 1;\n  });(function () {\n    function a(a, c) {\n      var d = U(a, \"Hours\");return Y(c).ampm[Q(d / 12)] || \"\";\n    }Z(\"t\", a, 1);Z(\"tt\", a);Z(\"T\", a, 1, 1);Z(\"TT\", a, null, 2);\n  })();\n  /* istanbul ignore next */\n  (function () {\n    function a(a, c) {\n      var d = U(a, \"Day\");return Y(c).weekdays[d];\n    }Z(\"dow\", a, 3);Z(\"Dow\", a, 3, 1);Z(\"weekday\", a);Z(\"Weekday\", a, null, 1);\n  })();nc(\"mon\", 0, 3);nc(\"month\", 0);nc(\"month2\", 1);nc(\"month3\", 2);X.ms = X.f;X.milliseconds = X.f;X.seconds = X.s;X.minutes = X.m;X.hours = X.h;X[\"24hr\"] = X.H;X[\"12hr\"] = X.h;X.date = X.d;X.day = X.d;X.year = X.yyyy;K(r, !0, !0, \"short,long,full\", function (a, b) {\n    a[b] = function (a) {\n      return qc(this, b, !1, a);\n    };\n  });\n  \"〇一二三四五六七八九十百千万\".split(\"\").forEach(function (a, b) {\n    9 < b && (b = za(10, b - 9));Lb[a] = b;\n  });xa(Lb, Ka);Mb = q(\"([期週周])?([〇一二三四五六七八九十百千万\" + Ja + \"]+)(?!昨)\", \"g\");\n  /* istanbul ignore next */\n  (function () {\n    var a = W.weekdays.slice(0, 7),\n        b = W.months.slice(0, 12);K(r, !0, !0, \"today yesterday tomorrow weekday weekend future past\".split(\" \").concat(a).concat(b), function (a, b) {\n      a[\"is\" + Yb(b)] = function (a) {\n        return this.is(b, 0, a);\n      };\n    });\n  })();r.utc || (r.utc = { create: function create() {\n      return tc(arguments, 0, !0);\n    }, past: function past() {\n      return tc(arguments, -1, !0);\n    }, future: function future() {\n      return tc(arguments, 1, !0);\n    } });\n  H(r, !1, !0, { RFC1123: \"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}\", RFC1036: \"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}\", ISO8601_DATE: \"{yyyy}-{MM}-{dd}\", ISO8601_DATETIME: \"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}\" });\n})();"
  },
  {
    "path": "dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "dist/util/colorFile.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\nvar chalk = {};\nvar map = { cyan: 36, red: 31, magenta: 35 };\nObject.keys(map).forEach(function (key, value) {\n  chalk[key] = function (str) {\n    return '\\u001b[' + value + 'm' + str + '\\u001b[39m';\n  };\n});\n\n/**\n * Wraps file strings in ANSI colors\n * based on their extension.\n *\n * @param {file} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (file) {\n  var audio = ['aac', 'au', 'flac', 'mid', 'midi', 'mka', 'mp3', 'mpc', 'ogg', 'ra', 'wav', 'axa', 'oga', 'spx', 'xspf'];\n  var archive = ['tar', 'tgz', 'arj', 'taz', 'lzh', 'lzma', 'tlz', 'txz', 'zip', 'z', 'Z', 'dz', 'gz', 'lz', 'xz', 'bz2', 'bz', 'tbz', 'tbz2', 'tz', 'deb', 'rpm', 'jar', 'rar', 'ace', 'zoo', 'cpio', '7z', 'rz'];\n  var images = ['jpg', 'jpeg', 'gif', 'bmp', 'pbm', 'pgm', 'ppm', 'tga', 'xbm', 'xpm', 'tif', 'tiff', 'png', 'svg', 'svgz', 'mng', 'pcx', 'mov', 'mpg', 'mpeg', 'm2v', 'mkv', 'ogm', 'mp4', 'm4v', 'mp4v', 'vob', 'qt', 'nuv', 'wmv', 'asf', 'rm', 'rmvb', 'flc', 'avi', 'fli', 'flv', 'gl', 'dl', 'xcf', 'xwd', 'yuv', 'cgm', 'emf', 'axv', 'anx', 'ogv', 'ogx'];\n\n  var extension = String(file).toLowerCase().trim().split('.');\n  extension = extension[extension.length - 1];\n\n  var colored = strip(file);\n  colored = audio.indexOf(extension) > -1 ? chalk.cyan(file) : archive.indexOf(extension) > -1 ? chalk.red(file) : images.indexOf(extension) > -1 ? chalk.magenta(file) : colored;\n\n  return colored;\n};"
  },
  {
    "path": "dist/util/columnify.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\nvar pad = require('./pad');\n\n/**\n * Formats an array to display in a TTY\n * in a pretty fashion.\n *\n * @param {Array} arr\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (arr, options) {\n  arr = arr || [];\n  options = options || {};\n  var bk = JSON.parse(JSON.stringify(arr));\n  var width = options.width && !isNaN(options.width) ? options.width : process.stdout.columns;\n  var longest = strip(bk.sort(function (a, b) {\n    return strip(b).length - strip(a).length;\n  })[0] || '').length + 2;\n  var fullWidth = strip(arr.join('')).length;\n  var fitsOneLine = fullWidth + arr.length * 2 <= width;\n  var cols = Math.floor(width / longest);\n  cols = cols < 1 ? 1 : cols;\n  if (fitsOneLine) {\n    return arr.join('  ');\n  }\n  var col = 0;\n  var lines = [];\n  var line = '';\n  for (var i = 0; i < arr.length; ++i) {\n    if (col < cols) {\n      col++;\n    } else {\n      if (String(strip(line)).trim() !== '') {\n        lines.push(line);\n      }\n      line = '';\n      col = 1;\n    }\n    if (cols === 1) {\n      // If we have files so damn\n      // long that we wrap, don't pad\n      // the lines.\n      line += arr[i];\n    } else {\n      // Pad the lines based on the\n      // longest word.\n      /* istanbul ignore next */\n      line += pad(arr[i], longest, ' ');\n    }\n  }\n  if (line !== '') {\n    lines.push(line);\n  }\n  return lines.join('\\n');\n};"
  },
  {
    "path": "dist/util/converter.date.js",
    "content": "'use strict';\n\n/**\n * Date conversion utilities\n */\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\nfunction pad(num, padding) {\n  padding = padding || '0';\n  num = parseFloat(num);\n  if (num < 10) {\n    return '' + padding + num;\n  }\n  return num;\n}\n\nmodule.exports = {\n  unix: function unix(dt) {\n    var date = dt;\n    var day = pad(date.getDate(), ' ');\n    var month = months[date.getMonth()];\n    var hour = pad(date.getHours());\n    var min = pad(date.getMinutes());\n    var hourMin = hour + ':' + min;\n    day = day.length === 1 ? ' ' + day : day;\n    date = month + ' ' + day + ' ' + hourMin;\n    return date;\n  }\n};"
  },
  {
    "path": "dist/util/converter.path.js",
    "content": "'use strict';\n\nvar path = require('path');\n\n/**\n * Path conversion utilities\n */\n\nmodule.exports = {\n  unix: function unix(str) {\n    var input = path.normalize(str);\n    input = input.replace(/\\\\/g, '\\/');\n    var parts = input.split(':');\n    var drive = parts.shift();\n    var isLetter = drive.length === 1 && drive.match(/[a-z]/i);\n    var result = isLetter ? drive + parts.join(':') : input;\n    return result;\n  }\n};"
  },
  {
    "path": "dist/util/converter.permissions.js",
    "content": "'use strict';\n\n/**\n * Permission conversion utilities\n */\n\nmodule.exports = {\n\n  listing: {\n    0: '---',\n    1: '--x',\n    2: '-w-',\n    3: '-wx',\n    4: 'r--',\n    5: 'r-x',\n    6: 'rw-',\n    7: 'rwx'\n  },\n\n  modeToRWX: function modeToRWX(mode) {\n    var octal = this.modeToOctal(mode);\n    var rwx = this.octalToRWX(octal);\n    return rwx;\n  },\n  modeToOctal: function modeToOctal(mode) {\n    var octal = '0' + (mode & 511).toString(8);\n    return octal;\n  },\n  octalToRWX: function octalToRWX(octal) {\n    if (!octal) {\n      return undefined;\n    }\n    var list = this.listing;\n    var a = list[String(octal).charAt(1)];\n    var b = list[String(octal).charAt(2)];\n    var c = list[String(octal).charAt(3)];\n    return a + b + c;\n  }\n};"
  },
  {
    "path": "dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "dist/util/fetch.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar expand = require('./expand');\n\n/**\n * Reads the contents of an array of\n * files and returns the array.\n *\n * @param {Array} files\n * @param {String} stdin\n * @param {Object} options\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (files, stdin, options) {\n  files = files || [];\n  stdin = stdin !== undefined ? stdin : [];\n  var f = expand(files);\n\n  if (!(f.length === 0 && files.length > 0)) {\n    files = f;\n  }\n\n  for (var i = 0; i < files.length; ++i) {\n    try {\n      var stat = fs.statSync(files[i]);\n      if (stat.isDirectory()) {\n        files[i] = options.onDirectory(files[i]);\n      } else {\n        files[i] = String(fs.readFileSync(path.normalize(files[i]), 'utf8'));\n      }\n    } catch (e) {\n      files[i] = options.onInvalidFile(files[i]);\n    }\n  }\n\n  var agg = files.length < 1 ? stdin : files;\n  var final = [];\n\n  for (var _i = 0; _i < agg.length; ++_i) {\n    if (agg[_i] !== undefined) {\n      final.push(agg[_i]);\n    }\n  }\n  return final;\n};"
  },
  {
    "path": "dist/util/fileFromPath.js",
    "content": "'use strict';\n\n/**\n * Parses a path and returns just the file\n *\n * @param {path} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (path) {\n  var fileShort = String(path).split('/');\n  fileShort = fileShort[fileShort.length - 1];\n  fileShort = fileShort.split('\\\\');\n  fileShort = fileShort[fileShort.length - 1];\n  return fileShort;\n};"
  },
  {
    "path": "dist/util/intercept.js",
    "content": "'use strict';\n\n/**\n * Intercepts stdout, passes thru callback\n * also pass console.error thru stdout so it goes to callback too\n * (stdout.write and stderr.write are both refs to the same stream.write function)\n * returns an unhook() function, call when done intercepting\n *\n * @param {Function} callback\n * @return {Function}\n */\n\nmodule.exports = function (callback) {\n  var oldStdoutWrite = process.stdout.write;\n  var oldConsoleError = console.error;\n  process.stdout.write = function (write) {\n    return function (string) {\n      var args = Array.from(arguments);\n      args[0] = interceptor(string);\n      write.apply(process.stdout, args);\n    };\n  }(process.stdout.write);\n\n  console.error = function () {\n    return function () {\n      var args = Array.from(arguments);\n      args.unshift('\\x1b[31m[ERROR]\\x1b[0m');\n      console.log.apply(console.log, args);\n    };\n  }(console.error);\n\n  function interceptor(string) {\n    // only intercept the string\n    var result = callback(string);\n    if (typeof result === 'string') {\n      string = result.replace(/\\n$/, '') + (result && /\\n$/.test(string) ? '\\n' : '');\n    }\n    return string;\n  }\n  // puts back to original\n  return function unhook() {\n    process.stdout.write = oldStdoutWrite;\n    console.error = oldConsoleError;\n  };\n};"
  },
  {
    "path": "dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "dist/util/lpad.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\n/**\n * Pads to the left hand.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  var len = Math.max(0, width - strip(str).length);\n  return Array(len + 1).join(delimiter) + str;\n};"
  },
  {
    "path": "dist/util/pad.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\n/**\n * Pads a value with with space or\n * a specified delimiter to match a\n * given width.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  var len = Math.max(0, width - strip(str).length);\n  return str + Array(len + 1).join(delimiter);\n};"
  },
  {
    "path": "dist/util/stripAnsi.js",
    "content": "'use strict';\n\n/**\n * Removes all ansi characters.\n *\n * @param {String} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str) {\n  var ansiRegex = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n  return typeof str === 'string' ? str.replace(ansiRegex, '') : str;\n};"
  },
  {
    "path": "dist/util/unlinkSync.js",
    "content": "'use strict';\n\nvar fs = require('fs');\n\n/**\n * Normalizes _unlinkSync() across\n * platforms to match Unix behavior, i.e.\n * file can be unlinked even its it's\n * read only.\n * See https://github.com/joyent/node/issues/3006\n *\n * @param {String} file\n * @api public\n */\n\nmodule.exports = function (file) {\n  try {\n    fs.unlinkSync(file);\n  } catch (e) {\n    // Try to override file permission\n    /* istanbul ignore if */\n    if (e.code === 'EPERM') {\n      fs.chmodSync(file, '0666');\n      fs.unlinkSync(file);\n    } else {\n      /* istanbul ignore next */\n      throw e;\n    }\n  }\n};"
  },
  {
    "path": "dist/util/walkDir.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\n/**\n * Walks a single directory calling\n * a callback function for each file or\n * folder, returning the path and results\n * of fs.statSync.\n *\n * @param {String} currentDirPath\n * @param {Function} callback\n * @param {Function} errorCallback\n * @api public\n */\nmodule.exports = function (currentDirPath, callback, errorCallback) {\n  /**\n   * @param {String} path\n   * @param {Function} cbk\n   * @param {Function} ecbk\n   */\n  function readFile(path, cbk, ecbk) {\n    try {\n      var stat = fs.statSync(path);\n      if (stat.isFile() || stat.isDirectory()) {\n        cbk(path, stat);\n      }\n    } catch (e) {\n      ecbk(path, e);\n    }\n  }\n\n  try {\n    var dirs = fs.readdirSync(currentDirPath);\n    dirs.forEach(function (name) {\n      var filePath = path.join(currentDirPath, name);\n      readFile(filePath, callback, errorCallback);\n    });\n  } catch (e) {\n    if (e.code === 'ENOTDIR') {\n      readFile(currentDirPath, callback, errorCallback);\n    } else {\n      errorCallback(currentDirPath, e);\n    }\n  }\n};"
  },
  {
    "path": "dist/util/walkDirRecursive.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\n/**\n * Recursively walks through and executes\n * a callback function for each directory found.\n *\n * @param {String} currentDirPath\n * @param {Function} callback\n * @api public\n */\n\nmodule.exports = function (currentDirPath, callback) {\n  fs.readdirSync(currentDirPath).forEach(function (name) {\n    var filePath = path.join(currentDirPath, name);\n    var stat = fs.statSync(filePath);\n    if (stat.isDirectory()) {\n      callback(filePath, stat);\n      module.exports(filePath, callback);\n    }\n  });\n};"
  },
  {
    "path": "dist/windows.js",
    "content": "'use strict';\n\nvar os = require('os');\nvar windows = os.platform() === 'win32';\n\nvar exclusions = require('./../commands.json').windowsExclusions;\n\nmodule.exports = {\n  registerCommands: function registerCommands(self) {\n    self.vorpal.catch('[words...]', 'Catches content').parse(function (input) {\n      // Look for aliases and translate them.\n      // Makes cash.alias and cash.unalias work.\n      var parts = String(input).split(' ');\n      var first = parts.shift();\n      var out = input;\n      var translation = self.vorpal._aliases[first];\n      if (self.vorpal._aliases && translation) {\n        /* istanbul ignore next */\n        out = translation + ' ' + parts.join(' ');\n      }\n      return out;\n    }).autocomplete(function () {\n      /* istanbul ignore next */\n      return self.vorpal.commands.map(function (c) {\n        return c._name;\n      });\n    }).action(function (args, cb) {\n      cb = cb || function () {};\n      var spawn = require('child_process').spawn;\n      var slf = this;\n\n      var words = args.words.join(' ');\n      var argus = void 0;\n\n      var cmd = void 0;\n      // Only register commands if on Windows.\n      /* istanbul ignore next */\n      if (windows) {\n        var excluded = false;\n        for (var i = 0; i < exclusions.length; ++i) {\n          if (String(words.slice(0, exclusions[i].length)).toLowerCase() === exclusions[i].toLowerCase()) {\n            excluded = true;\n            cmd = undefined;\n            argus = undefined;\n          }\n        }\n\n        if (!excluded) {\n          var parts = words.split(' ');\n          cmd = parts.shift();\n          argus = parts;\n          argus = argus.length === 1 && argus[0] === '' ? [] : argus;\n        }\n      }\n\n      // Accommodate tests for Linux.\n      if (words === 'cash-test') {\n        cmd = 'echo';\n        argus = ['hi'];\n      }\n\n      if (cmd === undefined || argus === undefined) {\n        slf.help();\n        cb();\n        return;\n      }\n\n      argus.unshift(cmd);\n      argus.unshift('/C');\n      var proc = void 0;\n      var out = '';\n      try {\n        proc = spawn('cmd', argus);\n      } catch (e) {\n        /* istanbul ignore next */\n        slf.log(e);\n      }\n\n      var closed = false;\n\n      // Properly print stdout as it's fed,\n      // waiting for line breaks before sending\n      // it to Vorpal.\n      function print() {\n        var parts = String(out).split('\\n');\n        /* istanbul ignore next */\n        if (parts.length > 1) {\n          out = parts.pop();\n          var logging = String(parts.join('\\n')).replace(/\\r\\r/g, '\\r');\n          slf.log(logging);\n        }\n        /* istanbul ignore next */\n        if (closed === false) {\n          setTimeout(function () {\n            print();\n          }, 50);\n        }\n      }\n      print();\n\n      // See if we get a Windows help on an\n      // invalid command and instead throw\n      // Cash help.\n      var windowsHelpFlag = false;\n      var windowsCommandReject = 'is not recognized as an internal or external command';\n\n      /* istanbul ignore next */\n      proc.stdout.on('data', function (data) {\n        out += data.toString('utf8');\n      });\n\n      /* istanbul ignore next */\n      proc.stderr.on('data', function (data) {\n        var str = data.toString('utf8');\n        if (windows && str.indexOf(windowsCommandReject) > -1) {\n          windowsHelpFlag = true;\n          return;\n        }\n        out += str;\n      });\n\n      proc.on('close', function () {\n        closed = true;\n        if (String(out).trim() !== '') {\n          slf.log(String(out).replace(/\\r\\r/g, '\\r'));\n          out = '';\n        }\n        if (windowsHelpFlag) {\n          slf.help();\n        }\n        /* istanbul ignore next */\n        setTimeout(function () {\n          cb();\n        }, 150);\n      });\n\n      proc.on('error', function (data) {\n        out += data.toString('utf8');\n      });\n    });\n  }\n};"
  },
  {
    "path": "gulpfile.js",
    "content": "'use strict';\n\nconst $ = require('shelljs');\nconst babel = require('gulp-babel');\nconst changed = require('gulp-changed');\nconst eslint = require('gulp-eslint');\nconst fs = require('fs');\nconst gulp = require('gulp');\n\ngulp.task('lint', function () {\n  return gulp.src(['src/*.js', './*.js', './bin/*.js'])\n    .pipe(eslint())\n    .pipe(eslint.format());\n});\ngulp.task('babel', function () {\n  const bab = babel();\n  gulp.src('src/**/*.js')\n    .pipe(changed('dist'))\n    .pipe(bab)\n    .pipe(gulp.dest('dist'));\n  return;\n});\n\ngulp.task('build', function () {\n  const commands = require('./commands.json');\n  for (let i = 0; i < commands.commands.length; ++i) {\n    const command = commands.commands[i];\n    const content = `#!/usr/bin/env node\\nrequire('./parser')(process.argv, '${command}');\\n`;\n    fs.writeFileSync(`./bin/${command}.js`, content);\n  }\n});\n\nfunction getJSON(name) {\n  const dir = `./packages/${name}`;\n  let json;\n  try {\n    json = fs.readFileSync(`${dir}/package.json`, {encoding: 'utf8', force: true});\n    json = JSON.parse(json);\n  } catch (e) {\n    $.cp('-f', `./packages/template.package.json`, `${dir}/package.json`);\n    return getJSON(name);\n  }\n  return json;\n}\n\nfunction writeJSON(name, json) {\n  const dir = `./packages/${name}`;\n  fs.writeFileSync(`${dir}/package.json`, `${JSON.stringify(json, null, '  ')}\\n`);\n}\n\ngulp.task('packages', function () {\n  const commands = require('./commands.json');\n\n  let related = '';\n  related += `- [cash](https://github.com/dthree/cash) - Main project\\n`;\n  related += `- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\\n`;\n  related += `- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\\n\\n`;\n  related += `#### Individual commands\\n\\n`;\n  for (const name in commands.packages) {\n    if (commands.packages.hasOwnProperty(name)) {\n      related += `- [cash-${name}](https://npmjs.com/package/cash-${name})\\n`;\n    }\n  }\n\n  related = related.replace(/\\n$/g, '');\n\n  for (const name in commands.packages) {\n    if (commands.packages.hasOwnProperty(name)) {\n      const pkg = commands.packages[name];\n      const deps = pkg.dependencies;\n      const files = pkg.files;\n      const dir = `./packages/${name}`;\n      $.rm('-rf', `${dir}/dist`);\n      $.mkdir('-p', `${dir}/dist/help`);\n      $.mkdir('-p', `${dir}/dist/lib`);\n      $.mkdir('-p', `${dir}/dist/commands`);\n      $.mkdir('-p', `${dir}/dist/util`);\n      $.mkdir('-p', `${dir}/bin`);\n      const json = getJSON(name);\n      const jsonMain = require('./package.json');\n      json.dependencies = {};\n      json.devDependencies = {};\n      const preparser = `./dist/preparser.js`;\n      const main = `./dist/commands/${name}.js`;\n      const help = `./dist/help/${name}.js`;\n      const bin = `./bin/${name}.js`;\n      $.cp('-f', main, `${dir}/${main}`);\n      $.cp('-f', bin, `${dir}/${bin}`);\n      $.cp('-f', help, `${dir}/${help}`);\n      $.cp('-f', preparser, `${dir}/${preparser}`);\n      $.cp('-f', './bin/parser.js', `${dir}/bin/parser.js`);\n      $.cp('-f', `./packages/template.README.md`, `${dir}/README.md`);\n      let readme = String($.cat(`${dir}/README.md`));\n      readme = readme.replace(/\\{package\\-name\\}/g, `cash-${name}`);\n      readme = readme.replace(/\\{command\\-name\\}/g, `${name}`);\n      readme = readme.replace(/\\{related\\}/g, related);\n      new $.ShellString(readme).to(`${dir}/README.md`);\n      for (let i = 0; i < files.length; ++i) {\n        $.cp('-f', files[i], `${dir}/${files[i]}`);\n      }\n      for (let i = 0; i < deps.length; ++i) {\n        json.dependencies[deps[i]] = jsonMain.dependencies[deps[i]];\n        if (json.dependencies[deps[i]] === undefined) {\n          throw new Error(`Sub-module dependency for \"${name}\" does not exist in the main package.json file.`);\n        }\n      }\n      json.files = ['dist', 'bin'];\n      json.dependencies.vorpal = jsonMain.dependencies.vorpal;\n      json.name = `cash-${name}`;\n      json.description = `Cross-platform implementation of the Unix '${name}' command.`;\n      json.main = main;\n      json.bin = json.bin || {};\n      json.bin[name] = bin;\n      writeJSON(name, json);\n    }\n  }\n  if ($.test('-e', './../cash-global/commands.json')) {\n    $.cp('./commands.json', './../cash-global/commands.json');\n  }\n});\n\ngulp.task('watch', function () {\n  gulp.watch('src/**/*.js', ['babel', 'build', 'packages']);\n  gulp.watch('commands.json', ['babel', 'build', 'packages']);\n  gulp.watch('test/**/*.js', ['babel', 'build', 'packages']);\n});\n\ngulp.task('default', ['babel', 'watch', 'build', 'packages']);\n\ngulp.task('builder', ['babel', 'build', 'packages']);\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"cash\",\n  \"version\": \"0.8.0\",\n  \"description\": \"Cross-platform Linux commands in pure ES6.\",\n  \"main\": \"./dist/index.js\",\n  \"scripts\": {\n    \"test\": \"gulp builder; ./node_modules/istanbul/lib/cli.js cover --root './dist' -x './dist/lib/sugar.js' _mocha -- -R spec && npm run lint\",\n    \"test-win\": \"mocha\",\n    \"lint\": \"xo ./src/*.js ./src/**/*.js ./test/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"shell\",\n    \"shelljs\",\n    \"bash\",\n    \"cash\",\n    \"$\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {\n    \"babel-core\": \"^6.5.2\",\n    \"babel-preset-es2015\": \"^6.5.0\",\n    \"coveralls\": \"^2.11.6\",\n    \"gulp\": \"^3.9.0\",\n    \"gulp-babel\": \"^6.1.2\",\n    \"gulp-changed\": \"^1.3.0\",\n    \"gulp-eslint\": \"^2.0.0\",\n    \"istanbul\": \"^0.4.2\",\n    \"mocha\": \"^2.2.5\",\n    \"shelljs\": \"^0.7.0\",\n    \"should\": \"^7.0.3\",\n    \"webpack\": \"^1.12.13\",\n    \"xo\": \"^0.12.1\"\n  },\n  \"bin\": {\n    \"$\": \"./bin/cash.js\",\n    \"cash\": \"./bin/cash.js\"\n  },\n  \"dependencies\": {\n    \"array-shuffle\": \"^1.0.0\",\n    \"chalk\": \"^1.1.0\",\n    \"filesize\": \"^3.1.3\",\n    \"fkill\": \"^4.0.0\",\n    \"fs-extra\": \"^0.26.7\",\n    \"glob\": \"^7.0.3\",\n    \"lodash\": \"^4.0.0\",\n    \"minimist\": \"^1.2.0\",\n    \"user-home\": \"^2.0.0\",\n    \"username\": \"^2.1.0\",\n    \"vorpal\": \"^1.10.8\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"vorpal-grep\": \"^0.1.2\",\n    \"vorpal-less\": \"0.0.13\",\n    \"which\": \"^1.2.4\"\n  },\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"commands.json\",\n    \"dist\",\n    \"bin\"\n  ],\n  \"xo\": {\n    \"envs\": [\n      \"node\",\n      \"mocha\"\n    ],\n    \"space\": true,\n    \"esnext\": true,\n    \"rules\": {\n      \"prefer-arrow-callback\": 0,\n      \"no-loop-func\": 0,\n      \"no-nested-ternary\": 0,\n      \"no-constant-condition\": 0,\n      \"no-use-extend-native/no-use-extend-native\": 0,\n      \"no-negated-condition\": 0,\n      \"no-inner-declarations\": 0,\n      \"prefer-reflect\": 0,\n      \"wrap-iife\": 0,\n      \"no-unused-expressions\": 0,\n      \"global-require\": 0\n    }\n  }\n}\n"
  },
  {
    "path": "packages/cat/README.md",
    "content": "# cash-cat\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `cat` command.\n\n```bash\nnpm install cash-cat -g\n```\n\nThis will install `cat` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> cat --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/cat/bin/cat.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'cat');\n"
  },
  {
    "path": "packages/cat/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/cat/dist/commands/cat.js",
    "content": "'use strict';\n\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar fetch = require('./../util/fetch');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar lpad = require('./../util/lpad');\nvar strip = require('./../util/stripAnsi');\n\nvar cat = {\n  exec: function exec(args, options) {\n    var self = this;\n\n    // Input normalization\n    if (args === undefined) {\n      args = {\n        files: []\n      };\n    } else if (typeof args === 'string' || args instanceof String) {\n      args = {\n        files: [args]\n      };\n    } else if (Array.isArray(args)) {\n      args = {\n        files: args\n      };\n    }\n\n    options = options || {};\n\n    // -A handler\n    if (options.showall) {\n      options.shownonprinting = true;\n      options.showends = true;\n      options.showtabs = true;\n    }\n\n    // -e handler\n    if (options.e) {\n      options.shownonprinting = true;\n      options.showends = true;\n    }\n\n    // -t handler\n    if (options.t) {\n      options.shownonprinting = true;\n      options.showtabs = true;\n    }\n\n    var stdout = '';\n    try {\n      var stdin = fetch(args.files, args.stdin, {\n        onDirectory: function onDirectory(name) {\n          return 'cat: ' + name + ': Is a directory';\n        },\n        onInvalidFile: function onInvalidFile(name) {\n          return 'cat: ' + name + ': No such file or directory';\n        }\n      });\n      var ctr = 0;\n      for (var i = 0; i < stdin.length; ++i) {\n        // If -s, squeeze double blank lines to a\n        // single line.\n        if (options.squeezeblank) {\n          stdin[i] = stdin[i].replace(/\\n\\n\\s*\\n/g, '\\n\\n');\n        }\n        if (options.showtabs) {\n          stdin[i] = stdin[i].replace(/\\t/g, '^I');\n        }\n        // Get rid of trailing line break because\n        // node logging does it anyway.\n        stdin[i] = stdin[i].replace(/\\s$/, '');\n        var parts = String(stdin[i]).split('\\n');\n        for (var j = 0; j < parts.length; ++j) {\n          var blank = strip(parts[j]).trim() === '';\n          // If -b, number every non-blank line\n          // If -n, number every line\n          var numbered = !blank && options.numbernonblank || options.number && !options.numbernonblank;\n          if (numbered) {\n            ctr++;\n          }\n          var numStr = numbered ? lpad(String(ctr), 6, ' ') + '  ' : '';\n          // If -E, append a $ to each line end.\n          var dollarStr = options.showends ? '$' : '';\n          var line = numStr + parts[j] + dollarStr;\n          stdout += line + '\\n';\n        }\n      }\n\n      if (stdout.length > 0) {\n        self.log(stdout.slice(0, stdout.length - 1));\n      }\n\n      return 0;\n    } catch (e) {\n      /* istanbul ignore next */\n      self.log(e.stack);\n      /* istanbul ignore next */\n      return 1;\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cat;\n  }\n  vorpal.api.cat = cat;\n  vorpal.command('cat [files...]').parse(preparser).option('-A, --show-all', 'equivalent to -vET').option('-b, --number-nonblank', 'number nonempty output lines, overrides -n').option('-e', 'equivalent to -vE').option('-E, --show-ends', 'display $ at end of each line').option('-n, --number', 'number all output lines').option('-s, --squeeze-blank', 'suppress repeated empty output lines').option('-t', 'equivalent to -vT').option('-T, --show-tabs', 'display TAB characters as ^I').option('-v, --show-nonprinting', 'use ^ and M- notation, except for LFD and TAB') // this doesn't work yet...\n  .autocomplete(fsAutocomplete()).action(function (args, cb) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: cat,\n      args: args,\n      options: args.options,\n      callback: cb\n    });\n  });\n};"
  },
  {
    "path": "packages/cat/dist/help/cat.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: cat [OPTION]... [FILE]...\\nConcatenate FILE(s), or standard input, to standard output.\\n\\n  -A, --show-all           equivalent to -vET\\n  -b, --number-nonblank    number nonempty output lines, overrides -n\\n  -e                       equivalent to -vE\\n  -E, --show-ends          display $ at end of each line\\n  -n, --number             number all output lines\\n  -s, --squeeze-blank      suppress repeated empty output lines\\n  -t                       equivalent to -vT\\n  -T, --show-tabs          display TAB characters as ^I\\n  -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB\\n      --help               display this help and exit\\n\\nWith no FILE, or when FILE is -, read standard input.\\n\\nExamples:\\n  cat f - g  Output f's contents, then standard input, then g's contents.\\n  cat        Copy standard input to standard output.\\n\\nReport cat bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/cat/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/cat/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/cat/dist/util/fetch.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar expand = require('./expand');\n\n/**\n * Reads the contents of an array of\n * files and returns the array.\n *\n * @param {Array} files\n * @param {String} stdin\n * @param {Object} options\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (files, stdin, options) {\n  files = files || [];\n  stdin = stdin !== undefined ? stdin : [];\n  var f = expand(files);\n\n  if (!(f.length === 0 && files.length > 0)) {\n    files = f;\n  }\n\n  for (var i = 0; i < files.length; ++i) {\n    try {\n      var stat = fs.statSync(files[i]);\n      if (stat.isDirectory()) {\n        files[i] = options.onDirectory(files[i]);\n      } else {\n        files[i] = String(fs.readFileSync(path.normalize(files[i]), 'utf8'));\n      }\n    } catch (e) {\n      files[i] = options.onInvalidFile(files[i]);\n    }\n  }\n\n  var agg = files.length < 1 ? stdin : files;\n  var final = [];\n\n  for (var _i = 0; _i < agg.length; ++_i) {\n    if (agg[_i] !== undefined) {\n      final.push(agg[_i]);\n    }\n  }\n  return final;\n};"
  },
  {
    "path": "packages/cat/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/cat/dist/util/lpad.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\n/**\n * Pads to the left hand.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  var len = Math.max(0, width - strip(str).length);\n  return Array(len + 1).join(delimiter) + str;\n};"
  },
  {
    "path": "packages/cat/dist/util/stripAnsi.js",
    "content": "'use strict';\n\n/**\n * Removes all ansi characters.\n *\n * @param {String} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str) {\n  var ansiRegex = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n  return typeof str === 'string' ? str.replace(ansiRegex, '') : str;\n};"
  },
  {
    "path": "packages/cat/package.json",
    "content": "{\n  \"name\": \"cash-cat\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'cat' command.\",\n  \"main\": \"./dist/commands/cat.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"cat\": \"./bin/cat.js\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.0.0\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/cp/README.md",
    "content": "# cash-cp\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `cp` command.\n\n```bash\nnpm install cash-cp -g\n```\n\nThis will install `cp` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> cp --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/cp/bin/cp.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'cp');\n"
  },
  {
    "path": "packages/cp/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/cp/dist/commands/cp.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar path = require('path');\nvar os = require('os');\n\nvar expand = require('./../util/expand');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar cp = {\n  exec: function exec(args, options) {\n    var self = this;\n    options = options || {};\n\n    args = args === undefined ? [] : args;\n    args = Array.isArray(args) ? args : args.split(' ');\n    args = args.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n\n    options.noclobber = options.force === true ? false : options.noclobber;\n    options.recursive = options.R === true ? true : options.recursive;\n\n    if (args.length < 1) {\n      this.log('cp: missing file operand\\nTry \\'cp --help\\' for more information.');\n      return 1;\n    }\n\n    if (args.length === 1) {\n      this.log('cp: missing destination file operand after ' + args[0] + '\\nTry \\'cp --help\\' for more information.');\n      return 1;\n    }\n\n    args = expand(args);\n\n    var dest = args.pop();\n    var sources = args;\n\n    var exists = fs.existsSync(dest);\n    var stats = exists && fs.statSync(dest);\n\n    // Dest is not existing dir, but multiple sources given\n    if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n      this.log('cp: target ' + dest + ' is not a directory');\n      return 1;\n    }\n\n    // Dest is an existing file, but no -f given\n    if (exists && stats.isFile() && options.noclobber) {\n      // just dont do anything\n      return 0;\n    }\n\n    if (options.recursive) {\n      sources.forEach(function (src, i) {\n        if (src[src.length - 1] === '/') {\n          sources[i] += '*';\n        } else if (fs.statSync(src).isDirectory() && !exists) {\n          sources[i] += '/*';\n        }\n      });\n      try {\n        fs.mkdirSync(dest, parseInt('0777', 8));\n      } catch (e) {\n        // like Unix's cp, keep going even if we can't create dest dir\n      }\n    }\n\n    sources = expand(sources);\n\n    sources.forEach(function (src) {\n      if (!fs.existsSync(src)) {\n        self.log('cp: cannot stat ' + src + ': No such file or directory');\n        return;\n      }\n\n      if (fs.statSync(src).isDirectory()) {\n        if (!options.recursive) {\n          self.log('cp: omitting directory ' + src);\n        } else {\n          // 'cp /a/source dest' should create 'source' in 'dest'\n          var newDest = path.join(dest, path.basename(src));\n          var checkDir = fs.statSync(src);\n          try {\n            fs.mkdirSync(newDest, checkDir.mode);\n          } catch (e) {\n            /* istanbul ignore if */\n            if (e.code !== 'EEXIST') {\n              throw new Error();\n            }\n          }\n          cpdirSyncRecursive.call(self, src, newDest, options);\n        }\n        return;\n      }\n\n      // If here, src is a file\n      // When copying to '/path/dir', iDest = '/path/dir/file1'\n      var iDest = dest;\n      if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) {\n        iDest = path.normalize(dest + '/' + path.basename(src));\n      }\n\n      if (fs.existsSync(iDest) && options.no_force) {\n        return;\n      }\n\n      copyFileSync.call(self, src, iDest);\n    });\n  }\n};\n\nfunction cpdirSyncRecursive(sourceDir, destDir, options) {\n  var self = this;\n  /* istanbul ignore if */\n  if (!options) {\n    options = {};\n  }\n  var checkDir = fs.statSync(sourceDir);\n  try {\n    fs.mkdirSync(destDir, checkDir.mode);\n  } catch (e) {\n    /* istanbul ignore if */\n    if (e.code !== 'EEXIST') {\n      throw e;\n    }\n  }\n  var files = fs.readdirSync(sourceDir);\n  for (var i = 0; i < files.length; i++) {\n    var srcFile = sourceDir + '/' + files[i];\n    var destFile = destDir + '/' + files[i];\n    var srcFileStat = fs.lstatSync(srcFile);\n    if (srcFileStat.isDirectory()) {\n      // recursion this thing right on back.\n      cpdirSyncRecursive.call(self, srcFile, destFile, options);\n    } else if (srcFileStat.isSymbolicLink()) {\n      var symlinkFull = fs.readlinkSync(srcFile);\n      fs.symlinkSync(symlinkFull, destFile, os.platform() === 'win32' ? 'junction' : null);\n      // At this point, we've hit a file actually worth copying... so copy it on over.\n    } else if (fs.existsSync(destFile) && options.noclobber) {\n        // be silent\n      } else {\n          copyFileSync.call(self, srcFile, destFile);\n        }\n  }\n}\n\nfunction copyFileSync(src, dest) {\n  /* istanbul ignore if */\n  if (!fs.existsSync(src)) {\n    this.log('cp: cannot stat ' + src + ': No such file or directory');\n    return;\n  }\n\n  var BUF_LENGTH = 64 * 1024;\n  var buf = new Buffer(BUF_LENGTH);\n  var bytesRead = BUF_LENGTH;\n  var pos = 0;\n  var fdr = null;\n  var fdw = null;\n\n  try {\n    fdr = fs.openSync(src, 'r');\n  } catch (e) {\n    /* istanbul ignore next */\n    this.log('cp: cannot open ' + src + ': ' + e.code);\n    /* istanbul ignore next */\n    return;\n  }\n\n  try {\n    fdw = fs.openSync(dest, 'w');\n  } catch (e) {\n    /* istanbul ignore next */\n    this.log('cp: cannot write to destination file ' + dest + ': ' + e.code);\n    /* istanbul ignore next */\n    return;\n  }\n\n  while (bytesRead === BUF_LENGTH) {\n    bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos);\n    fs.writeSync(fdw, buf, 0, bytesRead);\n    pos += bytesRead;\n  }\n\n  fs.closeSync(fdr);\n  fs.closeSync(fdw);\n  fs.chmodSync(dest, fs.statSync(src).mode);\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cp;\n  }\n  vorpal.api.cp = cp;\n  vorpal.command('cp [args...]').parse(preparser).option('-f, --force', 'do not prompt before overwriting').option('-n, --no-clobber', 'do not overwrite an existing file').option('-r, --recursive', 'copy directories recursively').option('-R', 'copy directories recursively').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: cp,\n      args: args.args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/cp/dist/help/cp.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: cp [OPTION]... [-T] SOURCE DEST\\n  or:  cp [OPTION]... SOURCE... DIRECTORY\\nCopy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\\n\\n  -f, --force           if an existing destination file cannot be\\n                          opened, remove it and try again (this option\\n                          is ignored when the -n option is also used)\\n  -n, --no-clobber      do not overwrite an existing file (overrides\\n                          a previous -i option)\\n  -R, -r, --recursive   copy directories recursively\\n      --help            display this help and exit\\n\\nReport cp bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/cp/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/cp/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/cp/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/cp/package.json",
    "content": "{\n  \"name\": \"cash-cp\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'cp' command.\",\n  \"main\": \"./dist/commands/cp.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"cp\": \"./bin/cp.js\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.0.0\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/false/README.md",
    "content": "# cash-false\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `false` command.\n\n```bash\nnpm install cash-false -g\n```\n\nThis will install `false` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> false --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/false/bin/false.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'false');\n"
  },
  {
    "path": "packages/false/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/false/dist/commands/false.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\n\nvar _false = {\n  exec: function exec() {\n    // Always return 1\n    return 1;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _false;\n  }\n  vorpal.api.false = _false;\n  vorpal.command('false').action(function (args, callback) {\n    return interfacer.call(this, {\n      command: _false,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/false/dist/help/false.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: false [OPTION]\\nDo nothing, unsuccessfully\\n\\nThis command simply exits with status 1 (failure).\\n\\n      --help   display this help and exit\\n\\nReport false bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/false/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/false/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/false/package.json",
    "content": "{\n  \"name\": \"cash-false\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Cross-platform implementation of the Unix 'false' command.\",\n  \"main\": \"./dist/commands/false.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"false\": \"./bin/false.js\"\n  },\n  \"dependencies\": {\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/head/README.md",
    "content": "# cash-head\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `head` command.\n\n```bash\nnpm install cash-head -g\n```\n\nThis will install `head` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> head --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/head/bin/head.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'head');\n"
  },
  {
    "path": "packages/head/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/head/dist/commands/head.js",
    "content": "'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar interfacer = require('./../util/interfacer');\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar expand = require('./../util/expand');\n\nvar head = {\n  exec: function exec(args, options) {\n    options = options || {};\n    args = args || '';\n    var source = args.stdin === undefined ? 'files' : 'stdin';\n\n    var lines = options.lines ? Math.abs(options.lines) : 10;\n    if (!Number.isInteger(lines)) {\n      this.log('head: ' + options.lines + ': invalid number of lines');\n      return 0;\n    }\n\n    /* istanbul ignore next */\n    if (source === 'stdin') {\n      var _stdout = head.readLines(args.stdin[0], lines);\n      _stdout = _stdout.replace(/\\n$/, '');\n      if (_stdout.trim() !== '') {\n        this.log(_stdout);\n      }\n      return 0;\n    }\n\n    var files = args.files || args;\n    files = (typeof files === 'undefined' ? 'undefined' : _typeof(files)) === 'object' && files !== null && !Array.isArray(files) ? [] : files;\n    files = files === undefined ? [] : files;\n    files = typeof files === 'string' ? String(files).split(' ') : files;\n    files = files.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n    files = expand(files);\n\n    var stdout = '';\n    var verbose = files.length > 1 && !options.silent || options.verbose;\n\n    for (var i = 0; i < files.length; i++) {\n      try {\n        var content = fs.readFileSync(files[i]).toString();\n        if (verbose) {\n          stdout += (i > 0 ? '\\n' : '') + '==> ' + files[i] + ' <==\\n';\n        }\n        stdout += head.readLines(content, lines);\n      } catch (e) {\n        stdout += 'head: cannot open ' + files[i] + ' for reading: No such file or directory';\n      }\n    }\n\n    stdout = stdout.replace(/\\n$/, '');\n    if (stdout.trim() !== '') {\n      this.log(stdout);\n    }\n\n    return 0;\n  },\n  readLines: function readLines(content, numberOfLines) {\n    var stdout = '';\n    var contentArray = content.split('\\n');\n    var linesToRead = numberOfLines >= contentArray.length ? contentArray.length : numberOfLines;\n    for (var i = 0; i < linesToRead; i++) {\n      if (stdout === '') {\n        stdout = contentArray[i] + '\\n';\n        continue;\n      }\n      stdout += contentArray[i] + '\\n';\n    }\n    return stdout;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return head;\n  }\n  vorpal.api.head = head;\n  vorpal.command('head [files...]').option('-n, --lines [number]', 'print the first K lines instead of the first 10').option('-q, --silent', 'Suppresses printing of headers when multiple files are being examined.').option('-v, --verbose', 'Always output headers giving file names.').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: head,\n      args: args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/head/dist/help/head.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: head [OPTION]... [FILE]...\\nPrint the first 10 lines of each FILE to standard output.\\nWith more than one FILE, precede each with a header giving the file name.\\nWith no FILE, or when FILE is -, read standard input.\\n\\n  -n, --lines <number>        output the last N lines, instead of the last 10\\n  -q, --silent                suppresses printing of headers when multiple files\\n                                are being examined\\n  -v, --verbose               always output headers giving file names\\n      --help                  display this help and exit\\n\\nReport head bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/head/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/head/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/head/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/head/package.json",
    "content": "{\n  \"name\": \"cash-head\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'head' command.\",\n  \"main\": \"./dist/commands/head.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"head\": \"./bin/head.js\"\n  },\n  \"dependencies\": {\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/kill/README.md",
    "content": "# cash-kill\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `kill` command.\n\n```bash\nnpm install cash-kill -g\n```\n\nThis will install `kill` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> kill --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/kill/bin/kill.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'kill');\n"
  },
  {
    "path": "packages/kill/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/kill/dist/commands/kill.js",
    "content": "'use strict';\n\nvar fkill = require('fkill');\nvar os = require('os');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar usage = 'kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]';\nvar windows = os.platform().indexOf('win') > -1;\nvar signals = {\n  SIGKILL: 9,\n  SIGTERM: 15,\n  KILL: 9,\n  TERM: 15,\n  9: 'KILL',\n  15: 'TERM'\n};\n\nvar kill = {\n  exec: function exec(args, options) {\n    options = options || {};\n\n    var procs = args;\n    procs = procs === undefined ? [] : procs;\n    procs = typeof procs === 'string' ? String(procs).split(' ') : procs;\n    procs = procs.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n\n    function log(str) {\n      if (options.vorpal) {\n        options.vorpal.log(str);\n      } else {\n        /* istanbul ignore next */\n        console.log(str);\n      }\n    }\n\n    if (options.l !== undefined) {\n      if (options.l === true) {\n        this.log(' 9) SIGKILL   15) SIGTERM');\n        return 0;\n      }\n      if (signals[options.l]) {\n        this.log(signals[options.l]);\n        return 0;\n      }\n      this.log('-cash: kill: ' + options.l + ': invalid signal specification');\n      return 0;\n    }\n\n    if (procs.length < 1) {\n      this.log(usage);\n      return 0;\n    }\n\n    var forced = options['9'] === true || options.n === 9 || String(options.s).toLowerCase() === 'sigkill' || String(options.s).toLowerCase() === 'kill';\n    var opts = { force: forced };\n\n    var _loop = function _loop(i) {\n      var proc = procs[i];\n      proc = !isNaN(proc) ? parseFloat(proc) : proc;\n      proc = windows && isNaN(proc) && proc.indexOf('.') === -1 ? proc + '.exe' : proc;\n      fkill(proc, opts).then(function () {\n        // .. chill\n      }).catch(function (err) {\n        if (String(err.message).indexOf('failed') > -1) {\n          log('-cash: kill: (' + proc + ') - No such process');\n        }\n      });\n    };\n\n    for (var i = 0; i < procs.length; ++i) {\n      _loop(i);\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return kill;\n  }\n  vorpal.api.kill = kill;\n  vorpal.command('kill [process...]').parse(preparser).option('-9', 'sigkill').option('-s [sig]', 'sig is a signal name').option('-n [sig]', 'sig is a signal number').option('-l [sigspec]', 'list the signal names').action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: kill,\n      args: args.process,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/kill/dist/help/kill.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: kill [OPTION] pid | jobspec ... or kill -l [sigspec]\\nSend a signal to a job.\\n\\nSend the processes identified by PID or JOBSPEC the signal named by\\nSIGSPEC or SIGNUM.  If neither SIGSPEC nor SIGNUM is present, then\\nSIGTERM is assumed.\\n\\n  -s sig         SIG is a signal name\\n  -n sig         SIG is a signal number\\n  -l [sigspec]   list the signal names; if arguments follow `-l' they\\n                 are assumed to be signal numbers for which names\\n                 should be listed\\n      --help     display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if an invalid option is given or an error occurs.\\n\\nReport kill bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/kill/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/kill/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/kill/package.json",
    "content": "{\n  \"name\": \"cash-kill\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'kill' command.\",\n  \"main\": \"./dist/commands/kill.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"kill\": \"./bin/kill.js\"\n  },\n  \"dependencies\": {\n    \"fkill\": \"^4.0.0\",\n    \"lodash\": \"^4.0.0\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/ls/README.md",
    "content": "# cash-ls\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `ls` command.\n\n```bash\nnpm install cash-ls -g\n```\n\nThis will install `ls` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> ls --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/ls/bin/ls.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'ls');\n"
  },
  {
    "path": "packages/ls/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/ls/dist/commands/ls.js",
    "content": "'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar chalk = require('chalk');\nvar filesize = require('filesize');\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar os = require('os');\n\nvar expand = require('./../util/expand');\nvar colorFile = require('./../util/colorFile');\nvar columnify = require('./../util/columnify');\nvar dateConverter = require('./../util/converter.date');\nvar fileFromPath = require('./../util/fileFromPath');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar pad = require('./../util/pad');\nvar lpad = require('./../util/lpad');\nvar permissionsConverter = require('./../util/converter.permissions');\nvar strip = require('./../util/stripAnsi');\nvar walkDir = require('./../util/walkDir');\nvar walkDirRecursive = require('./../util/walkDirRecursive');\n\nvar pads = { pad: pad, lpad: lpad };\n\nvar ls = {\n\n  self: null,\n\n  /**\n   * Main command execution.\n   *\n   * @return {Object} { status, stdout }\n   * @api public\n   * @param paths\n   * @param options\n   */\n  exec: function exec(paths, options) {\n    ls.self = this;\n    paths = paths !== null && !Array.isArray(paths) && (typeof paths === 'undefined' ? 'undefined' : _typeof(paths)) === 'object' ? paths.paths : paths;\n    paths = paths || ['.'];\n    paths = Array.isArray(paths) ? paths : [paths];\n    paths = expand(paths);\n\n    options = options || {};\n\n    var preSortedPaths = ls.preSortPaths(paths);\n\n    var dirResults = [];\n    for (var i = 0; i < preSortedPaths.dirs.length; ++i) {\n      if (options.recursive) {\n        var result = ls.execDirRecursive(preSortedPaths.dirs[i], options);\n        dirResults = dirResults.concat(result);\n      } else {\n        dirResults.push(ls.execDir(preSortedPaths.dirs[i], options));\n      }\n    }\n\n    var stdout = '';\n    if (preSortedPaths.files.length > 0) {\n      stdout += ls.execLsOnFiles('.', preSortedPaths.files, options).results;\n    }\n\n    var dirOutput = ls.formatAll(dirResults, options, dirResults.length + preSortedPaths.files.length > 1);\n    stdout += stdout && dirOutput ? '\\n\\n' + dirOutput : dirOutput;\n    if (strip(stdout).trim() !== '') {\n      ls.self.log(String(stdout).replace(/\\\\/g, '/'));\n    }\n\n    return 0;\n  },\n  preSortPaths: function preSortPaths(paths) {\n    var dirs = [];\n    var files = [];\n\n    for (var i = 0; i < paths.length; i++) {\n      var p = paths[i];\n      try {\n        var stat = fs.statSync(p);\n        if (stat.isDirectory()) {\n          dirs.push(p);\n        } else if (stat.isFile()) {\n          files.push({\n            file: p,\n            data: stat\n          });\n        }\n      } catch (e) {\n        e.syscall = 'scandir';\n        ls.error(p, e);\n      }\n    }\n    files.sort();\n    dirs.sort();\n\n    return { files: files, dirs: dirs };\n  },\n\n\n  /**\n   * Returns ls stderr and response codes\n   * for errors.\n   *\n   * @param {String} path\n   * @param {Error} e\n   * @param {String} e.code\n   * @param {String} e.syscall\n   * @param {String} e.stack\n   * @api private\n   */\n  error: function error(path, e) {\n    var status = void 0;\n    var stdout = void 0;\n\n    if (e.code === 'ENOENT' && e.syscall === 'scandir') {\n      status = 1;\n      stdout = 'ls: cannot access ' + path + ': No such file or directory';\n    } else {\n      status = 2;\n      stdout = e.stack;\n    }\n\n    ls.self.log(stdout);\n    return { status: status, stdout: stdout };\n  },\n\n\n  /**\n   * Recursively executes `execDir`.\n   * For use with `ls -R`.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @return {Array} results\n   * @api private\n   */\n\n  execDirRecursive: function execDirRecursive(path, options) {\n    var self = this;\n    var results = [];\n    walkDirRecursive(path, function (pth) {\n      var result = self.execDir(pth, options);\n      results.push(result);\n    });\n\n    return results;\n  },\n\n\n  /**\n   * Executes `ls` functionality\n   * for a given directory.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @return {{path: String, size: *, results: *}} results\n   * @api private\n   */\n  execDir: function execDir(path, options) {\n    var rawFiles = [];\n\n    function pushFile(file, data) {\n      rawFiles.push({\n        file: file,\n        data: data\n      });\n    }\n\n    // Add in implied current and parent dirs.\n    pushFile('.', fs.statSync('.'));\n    pushFile('..', fs.statSync('..'));\n\n    // Walk the passed in directory,\n    // pushing the results into `rawFiles`.\n    walkDir(path, pushFile, ls.error);\n\n    var o = ls.execLsOnFiles(path, rawFiles, options);\n    o.path = path;\n    return o;\n  },\n  execLsOnFiles: function execLsOnFiles(path, rawFiles, options) {\n    var files = [];\n    var totalSize = 0;\n\n    // Sort alphabetically be default,\n    // unless -U is specified, in which case\n    // we don't sort.\n    if (!options.U) {\n      rawFiles = rawFiles.sort(function (a, b) {\n        // Sort by size.\n        if (options.S) {\n          // Hack for windows - a directory lising\n          // in linux says the size is 4096, and Windows\n          // it's 0, leading to inconsistent sorts based\n          // on size, and failing tests.\n          var win = os.platform() === 'win32';\n          a.data.size = win && a.data.isDirectory() && a.data.size === 0 ? 4096 : a.data.size;\n          b.data.size = win && b.data.isDirectory() && b.data.size === 0 ? 4096 : b.data.size;\n          return a.data.size > b.data.size ? -1 : a.data.size < b.data.size ? 1 : 0;\n        }\n        if (options.t) {\n          // Sort by date modified.\n          return a.data.mtime < b.data.mtime ? 1 : b.data.mtime < a.data.mtime ? -1 : 0;\n        }\n        // Sort alphabetically - default.\n        var aFileName = fileFromPath(a.file).trim().toLowerCase().replace(/\\W/g, '');\n        var bFileName = fileFromPath(b.file).trim().toLowerCase().replace(/\\W/g, '');\n        return aFileName > bFileName ? 1 : aFileName < bFileName ? -1 : 0;\n      });\n    }\n\n    // Reverse whatever sort the user specified.\n    if (options.reverse) {\n      rawFiles.reverse();\n    }\n\n    var _loop = function _loop(i) {\n      var file = rawFiles[i].file;\n      var data = rawFiles[i].data;\n      var fileShort = fileFromPath(file);\n      var dotted = fileShort && fileShort.charAt(0) === '.';\n      var implied = fileShort === '..' || fileShort === '.';\n      var type = data.isDirectory() ? 'd' : '-';\n      var permissions = permissionsConverter.modeToRWX(data.mode);\n      var hardLinks = data.nlink;\n      var size = options.humanreadable ? filesize(data.size, { unix: true }) : data.size;\n      var modified = dateConverter.unix(data.mtime);\n      var owner = data.uid;\n      var group = data.gid;\n      var inode = data.ino;\n\n      totalSize += data.size;\n\n      var fileName = fileShort;\n\n      // If --classify, add '/' to end of folders.\n      fileName = options.classify && data.isDirectory() ? fileName + '/' : fileName;\n\n      // If getting --directory, give full path.\n      fileName = options.directory && file === '.' ? path : fileName;\n\n      // Color the files based on $LS_COLORS\n      fileName = data.isFile() ? colorFile(fileName) : fileName;\n\n      // If not already colored and is executable,\n      // make it green\n      var colored = strip(fileName) !== fileName;\n      if (String(permissions).indexOf('x') > -1 && !colored && data.isFile()) {\n        fileName = chalk.green(fileName);\n      }\n\n      // If --quote-name, wrap in double quotes;\n      fileName = options.quotename ? '\"' + fileName + '\"' : fileName;\n\n      // Make directories cyan.\n      fileName = data.isDirectory() ? chalk.cyan(fileName) : fileName;\n\n      var include = function () {\n        var directory = options.directory;\n        var all = options.all;\n        var almostAll = options.almostall;\n        var result = false;\n        if (directory && file !== '.') {\n          result = false;\n        } else if (!dotted) {\n          result = true;\n        } else if (all) {\n          result = true;\n        } else if (!implied && almostAll) {\n          result = true;\n        } else if (directory && file === '.') {\n          result = true;\n        }\n        return result;\n      }();\n\n      var details = [type + permissions, hardLinks, owner, group, size, modified, fileName];\n\n      if (options.inode) {\n        details.unshift(inode);\n      }\n\n      var result = options.l && !options.x ? details : fileName;\n\n      if (include) {\n        files.push(result);\n      }\n    };\n\n    for (var i = 0; i < rawFiles.length; ++i) {\n      _loop(i);\n    }\n\n    return ls.formatDetails(files, totalSize, options);\n  },\n  formatDetails: function formatDetails(files, totalSize, options) {\n    var result = void 0;\n\n    // If we have the detail view, draw out\n    // all of the details of each file.\n    // Otherwise, just throw the file names\n    // into columns.\n    if (Array.isArray(files[0])) {\n      var longest = {};\n      for (var i = 0; i < files.length; ++i) {\n        for (var j = 0; j < files[i].length; ++j) {\n          var len = String(files[i][j]).length;\n          longest[j] = longest[j] || 0;\n          longest[j] = len > longest[j] ? len : longest[j];\n        }\n      }\n\n      var newFiles = [];\n      for (var _i = 0; _i < files.length; ++_i) {\n        var glob = '';\n        for (var _j = 0; _j < files[_i].length; ++_j) {\n          var padFn = _j === files[_i].length - 1 ? 'pad' : 'lpad';\n          if (_j === files[_i].length - 1) {\n            glob += String(files[_i][_j]);\n          } else {\n            glob += pads[padFn](String(files[_i][_j]), longest[_j], ' ') + ' ';\n          }\n        }\n        newFiles.push(String(glob));\n      }\n      result = newFiles.join('\\n');\n    } else if (options['1']) {\n      result = files.join('\\n');\n    } else {\n      var opt = {};\n      if (options.width) {\n        opt.width = options.width;\n      }\n\n      result = columnify(files, opt);\n    }\n\n    return {\n      size: options.humanreadable ? filesize(totalSize, { unix: true }) : totalSize,\n      results: result\n    };\n  },\n\n\n  /**\n   * Concatenates the results of multiple\n   * `execDir` functions into their proper\n   * form based on options provided.\n   *\n   * @param {Array} results\n   * @param {Object} options\n   * @param {boolean} showName\n   * @return {String} stdout\n   * @api private\n   */\n\n  formatAll: function formatAll(results, options, showName) {\n    var stdout = '';\n    if (showName) {\n      for (var i = 0; i < results.length; ++i) {\n        stdout += results[i].path + ':\\n';\n        if (options.l) {\n          stdout += 'total ' + results[i].size + '\\n';\n        }\n        stdout += results[i].results;\n        if (i !== results.length - 1) {\n          stdout += '\\n\\n';\n        }\n      }\n    } else if (results.length === 1) {\n      if (options.l && !options.x) {\n        stdout += 'total ' + results[0].size + '\\n';\n      }\n      stdout += results[0].results;\n    }\n    return stdout;\n  }\n};\n\n/**\n * Expose as a Vorpal extension.\n */\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return ls;\n  }\n  vorpal.api.ls = ls;\n  vorpal.command('ls [paths...]').parse(preparser).option('-a, --all', 'do not ignore entries starting with .').option('-A, --almost-all', 'do not list implied . and ..').option('-d, --directory', 'list directory entries instead of contents, and do not dereference symbolic links').option('-F, --classify', 'append indicator (one of */=>@|) to entries').option('-h, --human-readable', 'with -l, print sizes in human readable format (e.g., 1K 234M 2G)').option('-i, --inode', 'print the index number of each file').option('-l', 'use a long listing format').option('-Q, --quote-name', 'enclose entry names in double quotes').option('-r, --reverse', 'reverse order while sorting').option('-R, --recursive', 'list subdirectories recursively').option('-S', 'sort by file size').option('-t', 'sort by modification time, newest first').option('-U', 'do not sort; list entries in directory order').option('-w, --width [COLS]', 'assume screen width instead of current value').option('-x', 'list entries by lines instead of columns').option('-1', 'list one file per line').autocomplete(fsAutocomplete()).action(function (args, cb) {\n    return interfacer.call(this, {\n      command: ls,\n      args: args.paths,\n      options: args.options,\n      callback: cb\n    });\n  });\n};"
  },
  {
    "path": "packages/ls/dist/help/ls.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: ls [OPTION]... [FILE]...\\nList information about the FILEs (the current directory by default).\\nSort entries alphabetically if none of -tSU nor --sort is specified.\\n\\n  -a, --all                  do not ignore entries starting with .\\n  -A, --almost-all           do not list implied . and ..\\n  -d, --directory            list directory entries instead of contents,\\n                               and do not dereference symbolic links\\n  -f                         do not sort, enable -aU, disable -ls --color\\n  -F, --classify             append indicator (one of */=>@|) to entries\\n  -h, --human-readable       with -l, print sizes in human readable format\\n  -i, --inode                print the index number of each file\\n  -l                         use a long listing format\\n  -q, --hide-control-chars   print ? instead of non graphic characters\\n  -r, --reverse              reverse order while sorting\\n  -R, --recursive            list subdirectories recursively\\n  -S                         sort by file size\\n  -t                         sort by modification time, newest first\\n  -U                         do not sort; list entries in directory order\\n  -w, --width=COLS           assume screen width instead of current value\\n  -x                         list entries by lines instead of by columns\\n  -1                         list one file per line\\n      --help                 display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if minor problems (e.g., cannot access subdirectory),\\n  2   if serious trouble (e.g., cannot access command-line argument).\\n\\nReport ls bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/ls/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/ls/dist/util/colorFile.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\nvar chalk = {};\nvar map = { cyan: 36, red: 31, magenta: 35 };\nObject.keys(map).forEach(function (key, value) {\n  chalk[key] = function (str) {\n    return '\\u001b[' + value + 'm' + str + '\\u001b[39m';\n  };\n});\n\n/**\n * Wraps file strings in ANSI colors\n * based on their extension.\n *\n * @param {file} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (file) {\n  var audio = ['aac', 'au', 'flac', 'mid', 'midi', 'mka', 'mp3', 'mpc', 'ogg', 'ra', 'wav', 'axa', 'oga', 'spx', 'xspf'];\n  var archive = ['tar', 'tgz', 'arj', 'taz', 'lzh', 'lzma', 'tlz', 'txz', 'zip', 'z', 'Z', 'dz', 'gz', 'lz', 'xz', 'bz2', 'bz', 'tbz', 'tbz2', 'tz', 'deb', 'rpm', 'jar', 'rar', 'ace', 'zoo', 'cpio', '7z', 'rz'];\n  var images = ['jpg', 'jpeg', 'gif', 'bmp', 'pbm', 'pgm', 'ppm', 'tga', 'xbm', 'xpm', 'tif', 'tiff', 'png', 'svg', 'svgz', 'mng', 'pcx', 'mov', 'mpg', 'mpeg', 'm2v', 'mkv', 'ogm', 'mp4', 'm4v', 'mp4v', 'vob', 'qt', 'nuv', 'wmv', 'asf', 'rm', 'rmvb', 'flc', 'avi', 'fli', 'flv', 'gl', 'dl', 'xcf', 'xwd', 'yuv', 'cgm', 'emf', 'axv', 'anx', 'ogv', 'ogx'];\n\n  var extension = String(file).toLowerCase().trim().split('.');\n  extension = extension[extension.length - 1];\n\n  var colored = strip(file);\n  colored = audio.indexOf(extension) > -1 ? chalk.cyan(file) : archive.indexOf(extension) > -1 ? chalk.red(file) : images.indexOf(extension) > -1 ? chalk.magenta(file) : colored;\n\n  return colored;\n};"
  },
  {
    "path": "packages/ls/dist/util/columnify.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\nvar pad = require('./pad');\n\n/**\n * Formats an array to display in a TTY\n * in a pretty fashion.\n *\n * @param {Array} arr\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (arr, options) {\n  arr = arr || [];\n  options = options || {};\n  var bk = JSON.parse(JSON.stringify(arr));\n  var width = options.width && !isNaN(options.width) ? options.width : process.stdout.columns;\n  var longest = strip(bk.sort(function (a, b) {\n    return strip(b).length - strip(a).length;\n  })[0] || '').length + 2;\n  var fullWidth = strip(arr.join('')).length;\n  var fitsOneLine = fullWidth + arr.length * 2 <= width;\n  var cols = Math.floor(width / longest);\n  cols = cols < 1 ? 1 : cols;\n  if (fitsOneLine) {\n    return arr.join('  ');\n  }\n  var col = 0;\n  var lines = [];\n  var line = '';\n  for (var i = 0; i < arr.length; ++i) {\n    if (col < cols) {\n      col++;\n    } else {\n      if (String(strip(line)).trim() !== '') {\n        lines.push(line);\n      }\n      line = '';\n      col = 1;\n    }\n    if (cols === 1) {\n      // If we have files so damn\n      // long that we wrap, don't pad\n      // the lines.\n      line += arr[i];\n    } else {\n      // Pad the lines based on the\n      // longest word.\n      /* istanbul ignore next */\n      line += pad(arr[i], longest, ' ');\n    }\n  }\n  if (line !== '') {\n    lines.push(line);\n  }\n  return lines.join('\\n');\n};"
  },
  {
    "path": "packages/ls/dist/util/converter.date.js",
    "content": "'use strict';\n\n/**\n * Date conversion utilities\n */\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\nfunction pad(num, padding) {\n  padding = padding || '0';\n  num = parseFloat(num);\n  if (num < 10) {\n    return '' + padding + num;\n  }\n  return num;\n}\n\nmodule.exports = {\n  unix: function unix(dt) {\n    var date = dt;\n    var day = pad(date.getDate(), ' ');\n    var month = months[date.getMonth()];\n    var hour = pad(date.getHours());\n    var min = pad(date.getMinutes());\n    var hourMin = hour + ':' + min;\n    day = day.length === 1 ? ' ' + day : day;\n    date = month + ' ' + day + ' ' + hourMin;\n    return date;\n  }\n};"
  },
  {
    "path": "packages/ls/dist/util/converter.permissions.js",
    "content": "'use strict';\n\n/**\n * Permission conversion utilities\n */\n\nmodule.exports = {\n\n  listing: {\n    0: '---',\n    1: '--x',\n    2: '-w-',\n    3: '-wx',\n    4: 'r--',\n    5: 'r-x',\n    6: 'rw-',\n    7: 'rwx'\n  },\n\n  modeToRWX: function modeToRWX(mode) {\n    var octal = this.modeToOctal(mode);\n    var rwx = this.octalToRWX(octal);\n    return rwx;\n  },\n  modeToOctal: function modeToOctal(mode) {\n    var octal = '0' + (mode & 511).toString(8);\n    return octal;\n  },\n  octalToRWX: function octalToRWX(octal) {\n    if (!octal) {\n      return undefined;\n    }\n    var list = this.listing;\n    var a = list[String(octal).charAt(1)];\n    var b = list[String(octal).charAt(2)];\n    var c = list[String(octal).charAt(3)];\n    return a + b + c;\n  }\n};"
  },
  {
    "path": "packages/ls/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/ls/dist/util/fileFromPath.js",
    "content": "'use strict';\n\n/**\n * Parses a path and returns just the file\n *\n * @param {path} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (path) {\n  var fileShort = String(path).split('/');\n  fileShort = fileShort[fileShort.length - 1];\n  fileShort = fileShort.split('\\\\');\n  fileShort = fileShort[fileShort.length - 1];\n  return fileShort;\n};"
  },
  {
    "path": "packages/ls/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/ls/dist/util/lpad.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\n/**\n * Pads to the left hand.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  var len = Math.max(0, width - strip(str).length);\n  return Array(len + 1).join(delimiter) + str;\n};"
  },
  {
    "path": "packages/ls/dist/util/pad.js",
    "content": "'use strict';\n\nvar strip = require('./stripAnsi');\n\n/**\n * Pads a value with with space or\n * a specified delimiter to match a\n * given width.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  var len = Math.max(0, width - strip(str).length);\n  return str + Array(len + 1).join(delimiter);\n};"
  },
  {
    "path": "packages/ls/dist/util/stripAnsi.js",
    "content": "'use strict';\n\n/**\n * Removes all ansi characters.\n *\n * @param {String} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str) {\n  var ansiRegex = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n  return typeof str === 'string' ? str.replace(ansiRegex, '') : str;\n};"
  },
  {
    "path": "packages/ls/dist/util/walkDir.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\n/**\n * Walks a single directory calling\n * a callback function for each file or\n * folder, returning the path and results\n * of fs.statSync.\n *\n * @param {String} currentDirPath\n * @param {Function} callback\n * @param {Function} errorCallback\n * @api public\n */\nmodule.exports = function (currentDirPath, callback, errorCallback) {\n  /**\n   * @param {String} path\n   * @param {Function} cbk\n   * @param {Function} ecbk\n   */\n  function readFile(path, cbk, ecbk) {\n    try {\n      var stat = fs.statSync(path);\n      if (stat.isFile() || stat.isDirectory()) {\n        cbk(path, stat);\n      }\n    } catch (e) {\n      ecbk(path, e);\n    }\n  }\n\n  try {\n    var dirs = fs.readdirSync(currentDirPath);\n    dirs.forEach(function (name) {\n      var filePath = path.join(currentDirPath, name);\n      readFile(filePath, callback, errorCallback);\n    });\n  } catch (e) {\n    if (e.code === 'ENOTDIR') {\n      readFile(currentDirPath, callback, errorCallback);\n    } else {\n      errorCallback(currentDirPath, e);\n    }\n  }\n};"
  },
  {
    "path": "packages/ls/dist/util/walkDirRecursive.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\n/**\n * Recursively walks through and executes\n * a callback function for each directory found.\n *\n * @param {String} currentDirPath\n * @param {Function} callback\n * @api public\n */\n\nmodule.exports = function (currentDirPath, callback) {\n  fs.readdirSync(currentDirPath).forEach(function (name) {\n    var filePath = path.join(currentDirPath, name);\n    var stat = fs.statSync(filePath);\n    if (stat.isDirectory()) {\n      callback(filePath, stat);\n      module.exports(filePath, callback);\n    }\n  });\n};"
  },
  {
    "path": "packages/ls/package.json",
    "content": "{\n  \"name\": \"cash-ls\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'ls' command.\",\n  \"main\": \"./dist/commands/ls.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"ls\": \"./bin/ls.js\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.0.0\",\n    \"chalk\": \"^1.1.0\",\n    \"filesize\": \"^3.1.3\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/mkdir/README.md",
    "content": "# cash-mkdir\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `mkdir` command.\n\n```bash\nnpm install cash-mkdir -g\n```\n\nThis will install `mkdir` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> mkdir --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/mkdir/bin/mkdir.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'mkdir');\n"
  },
  {
    "path": "packages/mkdir/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/mkdir/dist/commands/mkdir.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar mkdir = {\n  exec: function exec(args, options) {\n    var self = this;\n    var dirs = args || [];\n    options = options || {};\n\n    if (typeof dirs === 'string') {\n      dirs = dirs.split(' ');\n    }\n\n    dirs = dirs.filter(function (str) {\n      return String(str).trim() !== '';\n    });\n\n    if (dirs.length < 1) {\n      this.log('mkdir: missing operand\\nTry \\'mkdir --help\\' for more information.');\n    }\n\n    dirs.forEach(function (dir) {\n      if (fs.existsSync(dir)) {\n        if (!options.parents) {\n          self.log('mkdir: cannot create directory ' + dir + ': File exists');\n        }\n        return;\n      }\n\n      // Base dir does not exist, and no -p option given\n      var baseDir = path.dirname(dir);\n      if (!fs.existsSync(baseDir) && !options.parents) {\n        self.log('mkdir: cannot create directory ' + dir + ': No such file or directory');\n        return;\n      }\n\n      if (options.parents) {\n        mkdirSyncRecursive.call(self, dir, options);\n      } else {\n        fs.mkdirSync(dir, parseInt('0777', 8));\n        if (options.verbose) {\n          self.log('mkdir: created directory ' + dir);\n        }\n      }\n    });\n    return 0;\n  }\n};\n\nfunction mkdirSyncRecursive(dir, options) {\n  var baseDir = path.dirname(dir);\n  if (fs.existsSync(baseDir)) {\n    fs.mkdirSync(dir, parseInt('0777', 8));\n    if (options.verbose) {\n      this.log('mkdir: created directory ' + dir);\n    }\n    return;\n  }\n  mkdirSyncRecursive.call(this, baseDir, options);\n  fs.mkdirSync(dir, parseInt('0777', 8));\n  if (options.verbose) {\n    this.log('mkdir: created directory ' + dir);\n  }\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return mkdir;\n  }\n  vorpal.api.mkdir = mkdir;\n  vorpal.command('mkdir [directory...]').parse(preparser).option('-p, --parents', 'no error if existing, make parent directories as needed').option('-v, --verbose', 'print a message for each created directory').autocomplete(fsAutocomplete({ directory: true })).action(function (args, callback) {\n    args.options = args.options || {};\n    args.options.vorpal = vorpal;\n    return interfacer.call(this, {\n      command: mkdir,\n      args: args.directory,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/mkdir/dist/help/mkdir.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: mkdir [OPTION]... DIRECTORY...\\nCreate the DIRECTORY(ies), if they do not already exist.\\n\\n  -p, --parents     no error if existing, make parent directories as needed\\n  -v, --verbose     print a message for each created directory\\n      --help        display this help and exit\\n\\nReport mkdir bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/mkdir/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/mkdir/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/mkdir/package.json",
    "content": "{\n  \"name\": \"cash-mkdir\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'mkdir' command.\",\n  \"main\": \"./dist/commands/mkdir.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"mkdir\": \"./bin/mkdir.js\"\n  },\n  \"dependencies\": {\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/mv/README.md",
    "content": "# cash-mv\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `mv` command.\n\n```bash\nnpm install cash-mv -g\n```\n\nThis will install `mv` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> mv --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/mv/bin/mv.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'mv');\n"
  },
  {
    "path": "packages/mv/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/mv/dist/commands/mv.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\nvar path = require('path');\n\nvar expand = require('./../util/expand');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar mv = {\n  exec: function exec(args, options) {\n    var self = this;\n    options = options || {};\n\n    args = args === undefined ? [] : args;\n    args = Array.isArray(args) ? args : args.split(' ');\n    args = args.filter(function (arg) {\n      return String(arg).trim() !== '';\n    });\n\n    options.noclobber = options.force === true ? false : options.noclobber;\n\n    if (args.length < 1) {\n      this.log('mv: missing file operand\\nTry \\'mv --help\\' for more information.');\n      return 1;\n    }\n\n    if (args.length === 1) {\n      this.log('mv: missing destination file operand after ' + args[0] + '\\nTry \\'mv --help\\' for more information.');\n      return 1;\n    }\n\n    args = expand(args);\n\n    var dest = args.pop();\n    var sources = args;\n\n    var exists = fs.existsSync(dest);\n    var stats = exists && fs.statSync(dest);\n\n    // Dest is not existing dir, but multiple sources given\n    if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n      this.log('mv: target ' + dest + ' is not a directory');\n      return 1;\n    }\n\n    // Dest is an existing file, but no -f given\n    if (exists && stats.isFile() && options.noclobber) {\n      // just dont do anything\n      return 0;\n    }\n\n    if (options.striptrailingslashes) {\n      sources = sources.map(function (src) {\n        return String(src).replace(/\\/$/g, '');\n      });\n    }\n\n    sources.forEach(function (src) {\n      if (!fs.existsSync(src)) {\n        self.log('mv: cannot stat ' + src + ': No such file or directory');\n        return;\n      }\n\n      // When copying to '/path/dir', iDest = '/path/dir/file1'\n      var iDest = dest;\n      if (exists && stats.isDirectory()) {\n        iDest = path.normalize(dest + '/' + path.basename(src));\n      }\n\n      // If the file exists and we're not clobbering, skip.\n      if (fs.existsSync(iDest) && options.noclobber) {\n        return;\n      }\n\n      if (path.resolve(src) === path.dirname(path.resolve(iDest))) {\n        self.log('mv: ' + src + ' and ' + iDest + ' are the same file');\n        return;\n      }\n\n      fs.renameSync(src, iDest);\n      if (options.verbose === true) {\n        self.log(String(src + ' -> ' + iDest).replace(/\\\\/g, '/'));\n      }\n    });\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return mv;\n  }\n  vorpal.api.mv = mv;\n  vorpal.command('mv [args...]').parse(preparser).option('-f, --force', 'do not prompt before overwriting').option('-n, --no-clobber', 'do not overwrite an existing file').option('--striptrailingslashes', 'remove any trailing slashes from each source') // vorpal bug, need to add dashes between words\n  .option('-v, --verbose', 'explain what is being done').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: mv,\n      args: args.args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/mv/dist/help/mv.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: mv [OPTION]... [-T] SOURCE DEST\\n  or:  mv [OPTION]... SOURCE... DIRECTORY\\n  or:  mv [OPTION]... -t DIRECTORY SOURCE...\\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\\n\\n  -f, --force                  do not prompt before overwriting\\n  -n, --no-clobber             do not overwrite an existing file\\n      --striptrailingslashes   remove any trailing slashes from each SOURCE\\n                                 argument\\n  -v, --verbose                explain what is being done\\n      --help                   display this help and exit\\n\\nIf you specify -f and -n, only -f takes effect.\\n\\nReport mv bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/mv/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/mv/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/mv/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/mv/package.json",
    "content": "{\n  \"name\": \"cash-mv\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'mv' command.\",\n  \"main\": \"./dist/commands/mv.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"mv\": \"./bin/mv.js\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.0.0\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/pwd/README.md",
    "content": "# cash-pwd\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `pwd` command.\n\n```bash\nnpm install cash-pwd -g\n```\n\nThis will install `pwd` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> pwd --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/pwd/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/pwd/bin/pwd.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'pwd');\n"
  },
  {
    "path": "packages/pwd/dist/commands/pwd.js",
    "content": "'use strict';\n\nvar path = require('path');\n\nvar interfacer = require('./../util/interfacer');\n\nvar pwd = {\n  exec: function exec() {\n    this.log(path.resolve(process.cwd()).replace(/\\\\/g, '/'));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return pwd;\n  }\n  vorpal.api.pwd = pwd;\n  vorpal.command('pwd [files...]').action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: pwd,\n      args: args.files,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/pwd/dist/help/pwd.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: pwd [-LP]\\nPrint the name of the current working directory.\\n\\n      --help        display this help and exit\\n\\nExit status:\\n  0   if OK,\\n  1   if an invalid option is given or the current directory\\n      cannot be read.\\n\\nReport pwd bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/pwd/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/pwd/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/pwd/package.json",
    "content": "{\n  \"name\": \"cash-pwd\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'pwd' command.\",\n  \"main\": \"./dist/commands/pwd.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"pwd\": \"./bin/pwd.js\"\n  },\n  \"dependencies\": {\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/rm/README.md",
    "content": "# cash-rm\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `rm` command.\n\n```bash\nnpm install cash-rm -g\n```\n\nThis will install `rm` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> rm --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/rm/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/rm/bin/rm.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'rm');\n"
  },
  {
    "path": "packages/rm/dist/commands/rm.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar expand = require('./../util/expand');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar unlinkSync = require('./../util/unlinkSync');\n\nvar rm = {\n  exec: function exec(args, options) {\n    var self = this;\n    options = options || {};\n    options.recursive = options.R ? options.R : options.recursive;\n\n    var files = args;\n    files = files === undefined ? [] : files;\n    files = typeof files === 'string' ? [files] : files;\n\n    files = expand(files);\n\n    files.forEach(function (file) {\n      if (!fs.existsSync(file)) {\n        // Path does not exist, no force flag given\n        if (!options.force) {\n          self.log('rm: cannot remove ' + file + ': No such file or directory');\n          return 2;\n        }\n        /* istanbul ignore next */\n        return 0;\n      }\n\n      var stats = fs.lstatSync(file);\n      if (stats.isFile() || stats.isSymbolicLink()) {\n        if (options.force) {\n          unlinkSync(file);\n          return 0;\n        }\n\n        if (isWriteable(file)) {\n          unlinkSync(file);\n        } else {\n          /* istanbul ignore next */\n          self.log('rm: cannot remove ' + file + ': permission denied');\n          /* istanbul ignore next */\n          return 2;\n        }\n        return 0;\n      }\n\n      // Path is an existing directory, but no -r flag given\n      if (stats.isDirectory() && !options.recursive) {\n        self.log('rm: cannot remove: path is a directory');\n        return 2;\n      }\n\n      // Recursively remove existing directory\n      if (stats.isDirectory() && options.recursive) {\n        rmdirSyncRecursive.call(self, file, options.force, options.dir);\n      }\n    });\n  }\n};\n\nfunction rmdirSyncRecursive(dir, force, removeEmptyDir) {\n  var self = this;\n  var files = void 0;\n  files = fs.readdirSync(dir);\n\n  // Loop through and delete everything in the sub-tree after checking it\n  for (var i = 0; i < files.length; i++) {\n    var file = dir + '/' + files[i];\n    var currFile = fs.lstatSync(file);\n\n    if (currFile.isDirectory()) {\n      // Recursive function back to the beginning\n      rmdirSyncRecursive(file, force, removeEmptyDir);\n    } else if (currFile.isSymbolicLink()) {\n      // Unlink symlinks\n      /* istanbul ignore next */\n      if (force || isWriteable(file)) {\n        try {\n          unlinkSync(file);\n        } catch (e) {\n          self.log('rm: cannot remove ' + file + ': code ' + e.code);\n          return 2;\n        }\n      }\n    } else if (force || isWriteable(file)) {\n      // Assume it's a file.\n      try {\n        unlinkSync(file);\n      } catch (e) {\n        /* istanbul ignore next */\n        self.log('rm: cannot remove ' + file + ': code ' + e.code);\n        /* istanbul ignore next */\n        return 2;\n      }\n    }\n  }\n\n  // Now that we know everything in the sub-tree has been deleted,\n  // we can delete the main directory.\n  var result = void 0;\n  try {\n    // Retry on windows, sometimes it takes a little time before all the files in the directory are gone\n    var start = Date.now();\n    while (true) {\n      try {\n        result = fs.rmdirSync(dir);\n        /* istanbul ignore next */\n        if (fs.existsSync(dir)) {\n          throw new Error('EAGAIN');\n        }\n        break;\n      } catch (er) {\n        // In addition to error codes, also check if the directory still exists and loop again if true\n        /* istanbul ignore next */\n        if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) {\n          if (Date.now() - start > 1000) {\n            throw er;\n          }\n          /* istanbul ignore next */\n        } else if (er.code === 'ENOENT') {\n            // Directory did not exist, deletion was successful\n            break;\n            /* istanbul ignore next */\n          } else {\n              throw er;\n            }\n      }\n    }\n  } catch (e) {\n    /* istanbul ignore next */\n    self.log('rm: cannot remove directory ' + dir + ': code ' + e.code);\n    /* istanbul ignore next */\n    return 2;\n  }\n  return result;\n}\n\n// Hack to determine if file has write permissions for current user\n// Avoids having to check user, group, etc, but it's probably slow.\nfunction isWriteable(file) {\n  var writePermission = true;\n  try {\n    var __fd = fs.openSync(file, 'a');\n    fs.closeSync(__fd);\n  } catch (e) {\n    /* istanbul ignore next */\n    writePermission = false;\n  }\n\n  return writePermission;\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return rm;\n  }\n  vorpal.api.rm = rm;\n  vorpal.command('rm [files...]').parse(preparser).option('-f, --force', 'ignore nonexistent files and arguments, never prompt').option('-r, --recursive', 'remove directories and their contents recursively').option('-R', 'remove directories and their contents recursively').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: rm,\n      args: args.files,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/rm/dist/help/rm.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: rm [OPTION]... FILE...\\nRemove (unlink) the FILE(s).\\n\\n  -f, --force           ignore nonexistent files and arguments, never prompt\\n  -r, -R, --recursive   remove directories and their contents recursively\\n      --help            display this help and exit\\n\\nBy default, rm does not remove directories.  Use the --recursive (-r or -R)\\noption to remove each listed directory, too, along with all of its contents.\\n\\nTo remove a file whose name starts with a '-', for example '-foo',\\nuse one of these commands:\\n  rm -- -foo\\n  rm ./-foo\\n\\nNote that if you use rm to remove a file, it might be possible to recover\\nsome of its contents, given sufficient expertise and/or time.\\n\\nReport rm bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/rm/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/rm/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/rm/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/rm/dist/util/unlinkSync.js",
    "content": "'use strict';\n\nvar fs = require('fs');\n\n/**\n * Normalizes _unlinkSync() across\n * platforms to match Unix behavior, i.e.\n * file can be unlinked even its it's\n * read only.\n * See https://github.com/joyent/node/issues/3006\n *\n * @param {String} file\n * @api public\n */\n\nmodule.exports = function (file) {\n  try {\n    fs.unlinkSync(file);\n  } catch (e) {\n    // Try to override file permission\n    /* istanbul ignore if */\n    if (e.code === 'EPERM') {\n      fs.chmodSync(file, '0666');\n      fs.unlinkSync(file);\n    } else {\n      /* istanbul ignore next */\n      throw e;\n    }\n  }\n};"
  },
  {
    "path": "packages/rm/package.json",
    "content": "{\n  \"name\": \"cash-rm\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'rm' command.\",\n  \"main\": \"./dist/commands/rm.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"rm\": \"./bin/rm.js\"\n  },\n  \"dependencies\": {\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/sort/README.md",
    "content": "# cash-sort\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `sort` command.\n\n```bash\nnpm install cash-sort -g\n```\n\nThis will install `sort` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> sort --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/sort/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/sort/bin/sort.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'sort');\n"
  },
  {
    "path": "packages/sort/dist/commands/sort.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar fetch = require('./../util/fetch');\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nvar strip = require('./../util/stripAnsi');\nvar shuffle = require('array-shuffle');\n\nvar sort = {\n\n  counter: 0,\n\n  stdin: '',\n\n  exec: function exec(args, options) {\n    var self = this;\n\n    // Hack to handle multiple calls\n    // due to fragmented stdin, such as\n    // by piping. In essence, we're waiting\n    // 100 milliseconds for all of the\n    // requests to come in, and then running\n    // sort. Only applies when sort is called\n    // through a piped command.\n    /* istanbul ignore next */\n    if (args && args.stdin && options.bypass !== true) {\n      sort.counter++;\n      sort.stdin += args.stdin + '\\n';\n      if (sort.counter === 1) {\n        setTimeout(function () {\n          sort.counter = 0;\n          args.stdin = sort.stdin;\n          sort.stdin = '';\n          options.bypass = true;\n          sort.exec.call(self, args, options);\n        }, 100);\n      }\n      return;\n    }\n    sort.counter = 0;\n    sort.stdin = '';\n\n    // Input normalization\n    if (args === undefined) {\n      args = {\n        files: []\n      };\n    } else if (typeof args === 'string' || args instanceof String) {\n      args = {\n        files: [args]\n      };\n    } else if (Array.isArray(args)) {\n      args = {\n        files: args\n      };\n    }\n\n    options = options || {};\n\n    function log(stdout) {\n      if (options.output) {\n        if (options.output === true) {\n          self.log('sort: option \\'--output\\' requires an argument\\nTry \\'sort --help\\' for more information.');\n          return 0;\n        }\n        try {\n          fs.writeFileSync(options.output, stdout);\n          return 0;\n        } catch (e) {\n          if (e.code === 'ENOENT') {\n            self.log('sort: open failed: ' + options.output + ': No such file or directory');\n          } else {\n            /* istanbul ignore next */\n            self.log('sort: open failed: ' + options.output + ': ' + e.code);\n          }\n          return 2;\n        }\n      } else {\n        self.log(stdout);\n      }\n    }\n\n    try {\n      var stdin = fetch(args.files, args.stdin, {\n        onDirectory: function onDirectory(name) {\n          /* istanbul ignore next */\n          return 'sort: read failed: ' + name + ': Is a directory';\n        },\n        onInvalidFile: function onInvalidFile(name) {\n          /* istanbul ignore next */\n          return 'sort: cannot read: ' + name + ': No such file or directory';\n        }\n      });\n\n      var combined = '';\n      for (var i = 0; i < stdin.length; ++i) {\n        // Get rid of trailing line break because\n        // node logging does it anyway.\n        combined += stdin[i];\n      }\n\n      combined = combined.replace(/\\s$/, '');\n      var parts = String(combined).split('\\n');\n\n      if (options.check) {\n        // Check if the thing was already sorted.\n        var original = String(combined).split('\\n');\n        var disorder = void 0;\n        for (var _i = 0; _i < original.length; ++_i) {\n          var a = original[_i];\n          var b = original[_i + 1];\n          if (a && b) {\n            if (!isNaN(a) && !isNaN(b) && parseFloat(a) > parseFloat(b)) {\n              /* istanbul ignore next */\n              disorder = true;\n            } else if (a > b) {\n              disorder = true;\n            }\n            if (disorder) {\n              // To do: right now, I don't say the file\n              // name of the bad sorted item - I have to\n              // figure this out as I join all the files\n              // together beforehand and lose track.\n              disorder = 'sort: -:' + (_i + 2) + ': disorder: ' + b;\n              break;\n            }\n          }\n        }\n        if (disorder) {\n          log(disorder);\n          return;\n        }\n      }\n\n      parts = parts.sort(function (a, b) {\n        var aAlpha = strip(a).replace(/\\W+/g, '');\n        var bAlpha = strip(b).replace(/\\W+/g, '');\n        var aNumeric = strip(a).replace(/\\D/g, '');\n        var bNumeric = strip(b).replace(/\\D/g, '');\n        if (options.humannumericsort) {\n          var aHuman = parseHumanReadableNumbers(strip(a));\n          var bHuman = parseHumanReadableNumbers(strip(b));\n          if (aHuman.group < bHuman.group) {\n            return -1;\n          } else if (aHuman.group > bHuman.group) {\n            return 1;\n          } else if (aHuman.num < bHuman.num) {\n            return -1;\n          } else if (aHuman.num > bHuman.num) {\n            return 1;\n          }\n          return aAlpha.localeCompare(bAlpha);\n        } else if (options.monthsort) {\n          var aMonth = parseMonths(strip(a));\n          var bMonth = parseMonths(strip(b));\n          var result = aMonth - bMonth;\n          if (aMonth === bMonth) {\n            result = aAlpha.localeCompare(bAlpha);\n          }\n          return result;\n        } else if (options.numericsort) {\n          var _result = aNumeric - bNumeric;\n          _result = _result === 0 ? aAlpha.localeCompare(bAlpha) : _result;\n          return _result;\n        }\n        return aAlpha.localeCompare(bAlpha);\n      });\n\n      if (options.randomsort) {\n        parts = shuffle(parts);\n      }\n\n      if (options.reverse) {\n        parts.reverse();\n      }\n\n      var out = parts.join('\\n');\n      if (String(out).trim() !== '') {\n        log(out);\n      }\n\n      return;\n    } catch (e) {\n      /* istanbul ignore next */\n      self.log(e.stack);\n      /* istanbul ignore next */\n      return;\n    }\n  }\n};\n\n// This shit is gnarly.\n// Per the coreutils sort.c:\n// <none/unknown> < K/k < M < G < T < P < E < Z < Y\nvar humanOrdering = { '': 0, 'K': 1, 'k': 1, 'M': 2, 'G': 3, 'T': 4, 'P': 5, 'E': 6, 'Z': 7 };\nvar humanReadableSort = new RegExp(/^([0-9]+)?[\\.]?[0-9]+[K|k|M|G|T|P|E|Z|Y]/g);\nfunction parseHumanReadableNumbers(nbr) {\n  nbr = String(nbr).replace(/(\\r\\n|\\n|\\r)/gm, '');\n  if (String(nbr).match(humanReadableSort)) {\n    var num = parseFloat(String(nbr).replace(/[a-zA-Z]/g, '').trim());\n    var group = humanOrdering[String(nbr).replace(/[^a-zA-Z]/g, '').trim()] || 0;\n    return {\n      num: num,\n      group: group\n    };\n  }\n  var isNumber = String(nbr).match(/^[0-9]/);\n  var stripped = isNumber ? parseFloat(String(nbr).replace(/[^0-9.]/g, '')) : 'NaN';\n  var result = !isNaN(stripped) ? stripped : -99999999999;\n  return {\n    num: result,\n    group: 0\n  };\n}\n\nvar monthOrdering = {\n  jan: 1,\n  feb: 2,\n  mar: 3,\n  apr: 4,\n  may: 5,\n  jun: 6,\n  jul: 7,\n  aug: 8,\n  sep: 9,\n  oct: 10,\n  nov: 11,\n  dec: 12\n};\n\nvar months = new RegExp(/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i);\nfunction parseMonths(str) {\n  var match = String(str).match(months);\n  if (match) {\n    return monthOrdering[String(str.slice(0, 3).toLowerCase())];\n  }\n  return 0;\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return sort;\n  }\n  vorpal.api.sort = sort;\n  vorpal.command('sort [files...]').parse(preparser).option('-M, --month-sort', 'compare (unknown) < \\'JAN\\' < ... < \\'DEC\\'').option('-h, --human-numeric-sort', 'compare human readable numbers (e.g., 2K 1G)').option('-n, --numeric-sort', 'compare according to string numerical value').option('-R, --random-sort', 'sort by random hash of keys').option('-r, --reverse', 'reverse the result of comparisons').option('-c, --check', 'check for sorted input; do not sort').option('-o, --output [file]', 'write result to file instead of standard output').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: sort,\n      args: args,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/sort/dist/help/sort.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: sort [OPTION]... [FILE]...\\nWrite sorted concatenation of all FILE(s) to standard output.\\n\\nOrdering options:\\n  -M, --month-sort            compare (unknown) < 'JAN' < ... < 'DEC'\\n  -h, --human-numeric-sort    compare human readable numbers (e.g., 2K 1G)\\n  -n, --numeric-sort          compare according to string numerical value\\n  -R, --random-sort           sort by random hash of keys\\n  -r, --reverse               reverse the result of comparisons\\n\\nOther options:\\n  -c, --check,\\n      --check=diagnose-first  check for sorted input; do not sort\\n  -o, --output=FILE           write result to FILE instead of standard output\\n      --help                  display this help and exit\\n\\nWith no FILE, or when FILE is -, read standard input.\\n\\nReport sort bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/sort/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/sort/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/sort/dist/util/fetch.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar expand = require('./expand');\n\n/**\n * Reads the contents of an array of\n * files and returns the array.\n *\n * @param {Array} files\n * @param {String} stdin\n * @param {Object} options\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (files, stdin, options) {\n  files = files || [];\n  stdin = stdin !== undefined ? stdin : [];\n  var f = expand(files);\n\n  if (!(f.length === 0 && files.length > 0)) {\n    files = f;\n  }\n\n  for (var i = 0; i < files.length; ++i) {\n    try {\n      var stat = fs.statSync(files[i]);\n      if (stat.isDirectory()) {\n        files[i] = options.onDirectory(files[i]);\n      } else {\n        files[i] = String(fs.readFileSync(path.normalize(files[i]), 'utf8'));\n      }\n    } catch (e) {\n      files[i] = options.onInvalidFile(files[i]);\n    }\n  }\n\n  var agg = files.length < 1 ? stdin : files;\n  var final = [];\n\n  for (var _i = 0; _i < agg.length; ++_i) {\n    if (agg[_i] !== undefined) {\n      final.push(agg[_i]);\n    }\n  }\n  return final;\n};"
  },
  {
    "path": "packages/sort/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/sort/dist/util/stripAnsi.js",
    "content": "'use strict';\n\n/**\n * Removes all ansi characters.\n *\n * @param {String} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str) {\n  var ansiRegex = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n  return typeof str === 'string' ? str.replace(ansiRegex, '') : str;\n};"
  },
  {
    "path": "packages/sort/package.json",
    "content": "{\n  \"name\": \"cash-sort\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'sort' command.\",\n  \"main\": \"./dist/commands/sort.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"sort\": \"./bin/sort.js\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.0.0\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"array-shuffle\": \"^1.0.0\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/tail/README.md",
    "content": "# cash-tail\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `tail` command.\n\n```bash\nnpm install cash-tail -g\n```\n\nThis will install `tail` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> tail --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/tail/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/tail/bin/tail.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'tail');\n"
  },
  {
    "path": "packages/tail/dist/commands/tail.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar interfacer = require('./../util/interfacer');\nvar expand = require('./../util/expand');\nvar unixPath = require('./../util/converter.path').unix;\n\nvar tail = {\n  exec: function exec(args, options) {\n    options = options || {};\n    var lines = options.lines ? Math.abs(options.lines) : 10;\n    if (!Number.isInteger(lines)) {\n      this.log('tail: ' + options.lines + ': invalid number of lines');\n      return 0;\n    }\n\n    var files = args;\n    files = files === undefined ? [] : files;\n    files = typeof files === 'string' ? String(files).split(' ') : files;\n    files = files.filter(function (file) {\n      return String(file).trim() !== '';\n    });\n    files = expand(files);\n\n    var out = '';\n    for (var i = 0; i < files.length; i++) {\n      var fileFound = false;\n      var isFile = false;\n\n      try {\n        fs.accessSync(files[i], fs.F_OK);\n        fileFound = true;\n      } catch (e) {\n        out += 'tail: cannot open ' + unixPath(files[i]) + ' for reading: No such file or directory\\n';\n      }\n\n      if (fileFound) {\n        isFile = fs.statSync(files[i]).isFile();\n      }\n\n      if (isFile) {\n        var name = unixPath(files[i]);\n        var content = fs.readFileSync(files[i], 'utf8').trim().split('\\n');\n        var verbose = files.length > 1 && !options.silent || options.verbose;\n        if (verbose) {\n          out += '==> ' + name + ' <==\\n';\n        }\n        var sliced = content.slice(content.length - lines, content.length);\n        out += sliced.join('\\n') + '\\n';\n      }\n    }\n\n    out = out.replace(/\\n$/, '');\n    if (out.trim() !== '') {\n      this.log(out);\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return tail;\n  }\n  vorpal.api.tail = tail;\n  vorpal.command('tail [files...]').option('-n, --lines <number>', 'Output the last N lines, instead of the last 10').option('-q, --silent', 'Suppresses printing of headers when multiple files are being examined.').option('-v, --verbose', 'Always output headers giving file names.').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    args.options = args.options || {};\n    return interfacer.call(this, {\n      command: tail,\n      args: args.files,\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/tail/dist/help/tail.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: tail [OPTION]... [FILE]...\\nDisplay the last part of a file.\\n\\nPrint the last 10 lines of each FILE to standard output. With more\\nthan one FILE, precede each with a header giving the file name.\\n\\n  -n, --lines <number>        output the last N lines, instead of the last 10\\n  -q, --silent                suppresses printing of headers when multiple files\\n                                are being examined\\n  -v, --verbose               always output headers giving file names\\n      --help                  display this help and exit\\n\\nReport tail bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/tail/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/tail/dist/util/converter.path.js",
    "content": "'use strict';\n\nvar path = require('path');\n\n/**\n * Path conversion utilities\n */\n\nmodule.exports = {\n  unix: function unix(str) {\n    var input = path.normalize(str);\n    input = input.replace(/\\\\/g, '\\/');\n    var parts = input.split(':');\n    var drive = parts.shift();\n    var isLetter = drive.length === 1 && drive.match(/[a-z]/i);\n    var result = isLetter ? drive + parts.join(':') : input;\n    return result;\n  }\n};"
  },
  {
    "path": "packages/tail/dist/util/expand.js",
    "content": "'use strict';\n\nvar glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  var total = list.length;\n  var files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (var i = 0; i < total; ++i) {\n    var res = glob.sync(list[i], {});\n    files[i] = res.length > 0 ? res : list[i];\n  }\n  var out = [];\n  for (var _i = 0; _i < files.length; ++_i) {\n    out = Array.isArray(files[_i]) ? out.concat(files[_i]) : out.concat([files[_i]]);\n  }\n  return out;\n};"
  },
  {
    "path": "packages/tail/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/tail/package.json",
    "content": "{\n  \"name\": \"cash-tail\",\n  \"version\": \"0.0.2\",\n  \"description\": \"Cross-platform implementation of the Unix 'tail' command.\",\n  \"main\": \"./dist/commands/tail.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"tail\": \"./bin/tail.js\"\n  },\n  \"dependencies\": {\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"glob\": \"^7.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/template.README.md",
    "content": "# {package-name}\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `{command-name}` command.\n\n```bash\nnpm install {package-name} -g\n```\n\nThis will install `{command-name}` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> {command-name} --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n{related}\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/template.package.json",
    "content": "{\n  \"name\": \"\",\n  \"version\": \"0.0.1\",\n  \"description\": \"\",\n  \"main\": \"\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {},\n  \"dependencies\": {},\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}"
  },
  {
    "path": "packages/touch/README.md",
    "content": "# cash-touch\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `touch` command.\n\n```bash\nnpm install cash-touch -g\n```\n\nThis will install `touch` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> touch --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/touch/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/touch/bin/touch.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'touch');\n"
  },
  {
    "path": "packages/touch/dist/commands/touch.js",
    "content": "'use strict';\n\nvar fs = require('fs-extra');\nvar fsAutocomplete = require('vorpal-autocomplete-fs');\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\nrequire('./../lib/sugar');\n\nvar touch = {\n\n  /**\n   * Main command execution.\n   *\n   * @param {Object} args\n   * @return {Object} { status, stdout }\n   * @api public\n   */\n\n  exec: function exec(files, options) {\n    var self = this;\n    files = files || ['.'];\n    files = !Array.isArray(files) ? [files] : files;\n    options = options || {};\n\n    // If any version of --no-create is passed, change it to false.\n    options.create = options.create === true ? false : options.create;\n\n    // If --time is passed, ensure a valid param is called in\n    // and map it to -a or -m, as this is the equivalent of these.\n    // Throw an error if nothing valid passed.\n    if (options.time) {\n      var a = ['access', 'atime', 'use'];\n      var m = ['modify', 'mtime'];\n      var opt = a.indexOf(options.time) > -1 ? 'a' : m.indexOf(options.time) > -1 ? 'm' : undefined;\n      if (!opt) {\n        var error = 'touch: invalid argument \"' + options.time + '\" for \"--time\"\\n' + 'Valid arguments are:\\n' + '  - \"atime\", \"access\", \"use\"\\n' + '  - \"mtime\", \"modify\"\\n' + 'Try \\'touch --help\\' for more information.';\n        // I think this is the stupidest thing\n        // I've ever written.\n        try {\n          throw new Error(error);\n        } catch (e) {\n          return touch.error.call(self, e);\n        }\n      } else {\n        options[opt] = true;\n      }\n    }\n\n    try {\n      var err = false;\n      for (var i = 0; i < files.length; ++i) {\n        try {\n          touch.file(files[i], options);\n        } catch (e) {\n          err = e;\n          break;\n        }\n      }\n      if (err) {\n        return touch.error.call(self, err);\n      }\n      return 0;\n    } catch (e) {\n      return touch.error.call(self, e);\n    }\n  },\n\n\n  /**\n   * Returns touch stderr and response codes\n   * for errors.\n   *\n   * @param {Error} e\n   * @return {Object} { status, stdout }\n   * @api private\n   */\n\n  error: function error(e) {\n    this.log(e.message);\n    return 2;\n  },\n\n\n  /**\n   * Handler for a single file using touch.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @api private\n   */\n\n  file: function file(path, options) {\n    try {\n      try {\n        fs.lstatSync(path);\n      } catch (e) {\n        // If the file doesn't exist and\n        // the user doesn't want to create it,\n        // we have no purpose in life. Goodbye.\n        if (options.create === false) {\n          throw new Error(e);\n        } else {\n          fs.closeSync(fs.openSync(path, 'wx'));\n        }\n      }\n\n      var stat = fs.statSync(path);\n      var dateToSet = options.date ? Date.create(options.date) : new Date();\n\n      if (String(dateToSet) === 'Invalid Date') {\n        throw new Error('touch: invalid date format ' + options.date);\n      }\n\n      // If -m, keep access time current.\n      var atime = options.m === true ? new Date(stat.atime) : dateToSet;\n\n      // If -a, keep mod time to current.\n      var mtime = options.a === true ? new Date(stat.mtime) : dateToSet;\n\n      if (options.reference !== undefined) {\n        var reference = void 0;\n        try {\n          reference = fs.statSync(options.reference);\n        } catch (e) {\n          throw new Error('touch: failed to get attributes of ' + options.reference + ': No such file or directory');\n        }\n        atime = options.m === true ? atime : reference.atime;\n        mtime = options.a === true ? mtime : reference.mtime;\n      }\n\n      fs.utimesSync(path, atime, mtime);\n      fs.utimesSync(path, atime, mtime);\n    } catch (e) {\n      throw new Error(e);\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return touch;\n  }\n  vorpal.api.touch = touch;\n  vorpal.command('touch <files...>').parse(preparser).option('-a', 'change only the access time').option('-c, --no-create', 'do not create any files').option('-d, --date [STRING]', 'parse STRING and use it instead of current time').option('-m', 'change only the modification time').option('-r, --reference [FILE]', 'use this file\\'s times instead of current time').option('--time [WORD]', 'change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m').autocomplete(fsAutocomplete()).action(function (args, callback) {\n    return interfacer.call(this, {\n      command: touch,\n      args: args.files || [],\n      options: args.options,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/touch/dist/help/touch.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: touch [OPTION]... FILE...\\nUpdate the access and modification times of each FILE to the current time.\\n\\nA FILE argument that does not exist is created empty, unless -c is\\nsupplied.\\n\\n  -a                      change only the access time\\n  -c, --no-create         do not create any files\\n  -d, --date <STRING>     parse STRING and use it instead of current time\\n  -m                      change only the modification time\\n  -r, --reference <FILE>  use this file's times instead of current time\\n      --time <WORD>       change the specified time:\\n                            WORD is access, atime, or use: equivalent to -a\\n                            WORD is modify or mtime: equivalent to -m\\n      --help              display this help and exit\\n\\nReport touch bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/touch/dist/lib/sugar.js",
    "content": "\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n/*\n *  Sugar Library v1.4.1\n *\n *  Freely distributable and licensed under the MIT-style license.\n *  Copyright (c) 2014 Andrew Plummer\n *  http://sugarjs.com/\n *\n * ---------------------------- */\n/* istanbul ignore next */\n(function () {\n  function aa(a) {\n    return function () {\n      return a;\n    };\n  }\n  /* istanbul ignore next */\n  var m = Object,\n      p = Array,\n      q = RegExp,\n      r = Date,\n      s = String,\n      t = Number,\n      u = Math,\n      ba = \"undefined\" !== typeof global ? global : this,\n      v = m.prototype.toString,\n      da = m.prototype.hasOwnProperty,\n      ea = m.defineProperty && m.defineProperties,\n      fa = \"function\" === typeof q(),\n      ga = !(\"0\" in new s(\"a\")),\n      ia = {},\n      ja = /^\\[object Date|Array|String|Number|RegExp|Boolean|Arguments\\]$/,\n      w = \"Boolean Number String Array Date RegExp Function\".split(\" \"),\n      la = ka(\"boolean\", w[0]),\n      y = ka(\"number\", w[1]),\n      z = ka(\"string\", w[2]),\n      A = ma(w[3]),\n      C = ma(w[4]),\n      D = ma(w[5]),\n      F = ma(w[6]);\n  /* istanbul ignore next */\n  function ma(a) {\n    var b = \"Array\" === a && p.isArray || function (b, d) {\n      return (d || v.call(b)) === \"[object \" + a + \"]\";\n    };return ia[a] = b;\n  }function ka(a, b) {\n    function c(c) {\n      return G(c) ? v.call(c) === \"[object \" + b + \"]\" : (typeof c === \"undefined\" ? \"undefined\" : _typeof(c)) === a;\n    }return ia[b] = c;\n  }\n  function na(a) {\n    a.SugarMethods || (oa(a, \"SugarMethods\", {}), H(a, !1, !0, { extend: function extend(b, c, d) {\n        H(a, !1 !== d, c, b);\n      }, sugarRestore: function sugarRestore() {\n        return pa(this, a, arguments, function (a, c, d) {\n          oa(a, c, d.method);\n        });\n      }, sugarRevert: function sugarRevert() {\n        return pa(this, a, arguments, function (a, c, d) {\n          d.existed ? oa(a, c, d.original) : delete a[c];\n        });\n      } }));\n  }function H(a, b, c, d) {\n    var e = b ? a.prototype : a;na(a);I(d, function (d, f) {\n      var h = e[d],\n          l = J(e, d);F(c) && h && (f = qa(h, f, c));!1 === c && h || oa(e, d, f);a.SugarMethods[d] = { method: f, existed: l, original: h, instance: b };\n    });\n  }\n  function K(a, b, c, d, e) {\n    var g = {};d = z(d) ? d.split(\",\") : d;d.forEach(function (a, b) {\n      e(g, a, b);\n    });H(a, b, c, g);\n  }function pa(a, b, c, d) {\n    var e = 0 === c.length,\n        g = L(c),\n        f = !1;I(b.SugarMethods, function (b, c) {\n      if (e || -1 !== g.indexOf(b)) f = !0, d(c.instance ? a.prototype : a, b, c);\n    });return f;\n  }function qa(a, b, c) {\n    return function (d) {\n      return c.apply(this, arguments) ? b.apply(this, arguments) : a.apply(this, arguments);\n    };\n  }function oa(a, b, c) {\n    ea ? m.defineProperty(a, b, { value: c, configurable: !0, enumerable: !1, writable: !0 }) : a[b] = c;\n  }\n  function L(a, b, c) {\n    var d = [];c = c || 0;var e;for (e = a.length; c < e; c++) {\n      d.push(a[c]), b && b.call(a, a[c], c);\n    }return d;\n  }function sa(a, b, c) {\n    var d = a[c || 0];A(d) && (a = d, c = 0);L(a, b, c);\n  }function ta(a) {\n    if (!a || !a.call) throw new TypeError(\"Callback is not callable\");\n  }function M(a) {\n    return void 0 !== a;\n  }function N(a) {\n    return void 0 === a;\n  }function J(a, b) {\n    return !!a && da.call(a, b);\n  }function G(a) {\n    return !!a && (\"object\" === (typeof a === \"undefined\" ? \"undefined\" : _typeof(a)) || fa && D(a));\n  }function ua(a) {\n    var b = typeof a === \"undefined\" ? \"undefined\" : _typeof(a);return null == a || \"string\" === b || \"number\" === b || \"boolean\" === b;\n  }\n  function va(a, b) {\n    b = b || v.call(a);try {\n      if (a && a.constructor && !J(a, \"constructor\") && !J(a.constructor.prototype, \"isPrototypeOf\")) return !1;\n    } catch (c) {\n      return !1;\n    }return !!a && \"[object Object]\" === b && \"hasOwnProperty\" in a;\n  }function I(a, b) {\n    for (var c in a) {\n      if (J(a, c) && !1 === b.call(a, c, a[c], a)) break;\n    }\n  }function wa(a, b) {\n    for (var c = 0; c < a; c++) {\n      b(c);\n    }\n  }function xa(a, b) {\n    I(b, function (c) {\n      a[c] = b[c];\n    });return a;\n  }function ya(a) {\n    ua(a) && (a = m(a));if (ga && z(a)) for (var b = a, c = 0, d; d = b.charAt(c);) {\n      b[c++] = d;\n    }return a;\n  }function O(a) {\n    xa(this, ya(a));\n  }\n  O.prototype.constructor = m;var P = u.abs,\n      za = u.pow,\n      Aa = u.ceil,\n      Q = u.floor,\n      R = u.round,\n      Ca = u.min,\n      S = u.max;function Da(a, b, c) {\n    var d = za(10, P(b || 0));c = c || R;0 > b && (d = 1 / d);return c(a * d) / d;\n  }var Ea = 48,\n      Fa = 57,\n      Ga = 65296,\n      Ha = 65305,\n      Ia = \".\",\n      Ja = \"\",\n      Ka = {},\n      La;function Ma() {\n    return \"\\t\\n\\u000b\\f\\r   ᠎             \\u2028\\u2029　﻿\";\n  }function Na(a, b) {\n    var c = \"\";for (a = a.toString(); 0 < b;) {\n      if (b & 1 && (c += a), b >>= 1) a += a;\n    }return c;\n  }\n  function Oa(a, b) {\n    var c, d;c = a.replace(La, function (a) {\n      a = Ka[a];a === Ia && (d = !0);return a;\n    });return d ? parseFloat(c) : parseInt(c, b || 10);\n  }function T(a, b, c, d) {\n    d = P(a).toString(d || 10);d = Na(\"0\", b - d.replace(/\\.\\d+/, \"\").length) + d;if (c || 0 > a) d = (0 > a ? \"-\" : \"+\") + d;return d;\n  }function Pa(a) {\n    if (11 <= a && 13 >= a) return \"th\";switch (a % 10) {case 1:\n        return \"st\";case 2:\n        return \"nd\";case 3:\n        return \"rd\";default:\n        return \"th\";}\n  }\n  function Qa(a, b) {\n    function c(a, c) {\n      if (a || -1 < b.indexOf(c)) d += c;\n    }var d = \"\";b = b || \"\";c(a.multiline, \"m\");c(a.ignoreCase, \"i\");c(a.global, \"g\");c(a.u, \"y\");return d;\n  }function Ra(a) {\n    z(a) || (a = s(a));return a.replace(/([\\\\/\\'*+?|()\\[\\]{}.^$])/g, \"\\\\$1\");\n  }function U(a, b) {\n    return a[\"get\" + (a._utc ? \"UTC\" : \"\") + b]();\n  }function Sa(a, b, c) {\n    return a[\"set\" + (a._utc && \"ISOWeek\" != b ? \"UTC\" : \"\") + b](c);\n  }\n  function Ta(a, b) {\n    var c = typeof a === \"undefined\" ? \"undefined\" : _typeof(a),\n        d,\n        e,\n        g,\n        f,\n        h,\n        l,\n        n;if (\"string\" === c) return a;g = v.call(a);d = va(a, g);e = A(a, g);if (null != a && d || e) {\n      b || (b = []);if (1 < b.length) for (l = b.length; l--;) {\n        if (b[l] === a) return \"CYC\";\n      }b.push(a);d = a.valueOf() + s(a.constructor);f = e ? a : m.keys(a).sort();l = 0;for (n = f.length; l < n; l++) {\n        h = e ? l : f[l], d += h + Ta(a[h], b);\n      }b.pop();\n    } else d = -Infinity === 1 / a ? \"-0\" : s(a && a.valueOf ? a.valueOf() : a);return c + g + d;\n  }function Ua(a, b) {\n    return a === b ? 0 !== a || 1 / a === 1 / b : Va(a) && Va(b) ? Ta(a) === Ta(b) : !1;\n  }\n  function Va(a) {\n    var b = v.call(a);return ja.test(b) || va(a, b);\n  }function Wa(a, b, c) {\n    var d,\n        e = a.length,\n        g = b.length,\n        f = !1 !== b[g - 1];if (!(g > (f ? 1 : 2))) return Xa(a, e, b[0], f, c);d = [];L(b, function (b) {\n      if (la(b)) return !1;d.push(Xa(a, e, b, f, c));\n    });return d;\n  }function Xa(a, b, c, d, e) {\n    d && (c %= b, 0 > c && (c = b + c));return e ? a.charAt(c) : a[c];\n  }function Ya(a, b) {\n    K(b, !0, !1, a, function (a, b) {\n      a[b + (\"equal\" === b ? \"s\" : \"\")] = function () {\n        return m[b].apply(null, [this].concat(L(arguments)));\n      };\n    });\n  }na(m);I(w, function (a, b) {\n    na(ba[b]);\n  });var Za, $a;\n  for ($a = 0; 9 >= $a; $a++) {\n    Za = s.fromCharCode($a + Ga), Ja += Za, Ka[Za] = s.fromCharCode($a + Ea);\n  }Ka[\",\"] = \"\";Ka[\"．\"] = Ia;Ka[Ia] = Ia;La = q(\"[\" + Ja + \"．,\" + Ia + \"]\", \"g\");\n  \"use strict\";H(m, !1, !1, { keys: function keys(a) {\n      var b = [];if (!G(a) && !D(a) && !F(a)) throw new TypeError(\"Object required\");I(a, function (a) {\n        b.push(a);\n      });return b;\n    } });\n  function ab(a, b, c, d) {\n    var e = a.length,\n        g = -1 == d,\n        f = g ? e - 1 : 0;c = isNaN(c) ? f : parseInt(c >> 0);0 > c && (c = e + c);if (!g && 0 > c || g && c >= e) c = f;for (; g && 0 <= c || !g && c < e;) {\n      if (a[c] === b) return c;c += d;\n    }return -1;\n  }function bb(a, b, c, d) {\n    var e = a.length,\n        g = 0,\n        f = M(c);ta(b);if (0 != e || f) f || (c = a[d ? e - 1 : g], g++);else throw new TypeError(\"Reduce called on empty array with no initial value\");for (; g < e;) {\n      f = d ? e - g - 1 : g, f in a && (c = b(c, a[f], f, a)), g++;\n    }return c;\n  }function cb(a) {\n    if (0 === a.length) throw new TypeError(\"First argument must be defined\");\n  }H(p, !1, !1, { isArray: function isArray(a) {\n      return A(a);\n    } });\n  H(p, !0, !1, { every: function every(a, b) {\n      var c = this.length,\n          d = 0;for (cb(arguments); d < c;) {\n        if (d in this && !a.call(b, this[d], d, this)) return !1;d++;\n      }return !0;\n    }, some: function some(a, b) {\n      var c = this.length,\n          d = 0;for (cb(arguments); d < c;) {\n        if (d in this && a.call(b, this[d], d, this)) return !0;d++;\n      }return !1;\n    }, map: function map(a, b) {\n      b = arguments[1];var c = this.length,\n          d = 0,\n          e = Array(c);for (cb(arguments); d < c;) {\n        d in this && (e[d] = a.call(b, this[d], d, this)), d++;\n      }return e;\n    }, filter: function filter(a) {\n      var b = arguments[1],\n          c = this.length,\n          d = 0,\n          e = [];for (cb(arguments); d < c;) {\n        d in this && a.call(b, this[d], d, this) && e.push(this[d]), d++;\n      }return e;\n    }, indexOf: function indexOf(a, b) {\n      return z(this) ? this.indexOf(a, b) : ab(this, a, b, 1);\n    }, lastIndexOf: function lastIndexOf(a, b) {\n      return z(this) ? this.lastIndexOf(a, b) : ab(this, a, b, -1);\n    }, forEach: function forEach(a, b) {\n      var c = this.length,\n          d = 0;for (ta(a); d < c;) {\n        d in this && a.call(b, this[d], d, this), d++;\n      }\n    }, reduce: function reduce(a, b) {\n      return bb(this, a, b);\n    }, reduceRight: function reduceRight(a, b) {\n      return bb(this, a, b, !0);\n    } });\n  H(Function, !0, !1, { bind: function bind(a) {\n      var b = this,\n          c = L(arguments, null, 1),\n          d;if (!F(this)) throw new TypeError(\"Function.prototype.bind called on a non-function\");d = function d() {\n        return b.apply(b.prototype && this instanceof b ? this : a, c.concat(L(arguments)));\n      };d.prototype = this.prototype;return d;\n    } });H(r, !1, !1, { now: function now() {\n      return new r().getTime();\n    } });\n  (function () {\n    var a = Ma().match(/^\\s+$/);try {\n      s.prototype.trim.call([1]);\n    } catch (b) {\n      a = !1;\n    }H(s, !0, !a, { trim: function trim() {\n        return this.toString().trimLeft().trimRight();\n      }, trimLeft: function trimLeft() {\n        return this.replace(q(\"^[\" + Ma() + \"]+\"), \"\");\n      }, trimRight: function trimRight() {\n        return this.replace(q(\"[\" + Ma() + \"]+$\"), \"\");\n      } });\n  })();\n  (function () {\n    var a = new r(r.UTC(1999, 11, 31)),\n        a = a.toISOString && \"1999-12-31T00:00:00.000Z\" === a.toISOString();K(r, !0, !a, \"toISOString,toJSON\", function (a, c) {\n      a[c] = function () {\n        return T(this.getUTCFullYear(), 4) + \"-\" + T(this.getUTCMonth() + 1, 2) + \"-\" + T(this.getUTCDate(), 2) + \"T\" + T(this.getUTCHours(), 2) + \":\" + T(this.getUTCMinutes(), 2) + \":\" + T(this.getUTCSeconds(), 2) + \".\" + T(this.getUTCMilliseconds(), 3) + \"Z\";\n      };\n    });\n  })();\n  \"use strict\";\n  var W,\n      Ib,\n      Jb = \"ampm hour minute second ampm utc offset_sign offset_hours offset_minutes ampm\".split(\" \"),\n      Kb = \"({t})?\\\\s*(\\\\d{1,2}(?:[,.]\\\\d+)?)(?:{h}([0-5]\\\\d(?:[,.]\\\\d+)?)?{m}(?::?([0-5]\\\\d(?:[,.]\\\\d+)?){s})?\\\\s*(?:({t})|(Z)|(?:([+-])(\\\\d{2,2})(?::?(\\\\d{2,2}))?)?)?|\\\\s*({t}))\",\n      Lb = {},\n      Mb,\n      Nb,\n      Ob,\n      Pb = [],\n      Qb = {},\n      X = { yyyy: function yyyy(a) {\n      return U(a, \"FullYear\");\n    }, yy: function yy(a) {\n      return U(a, \"FullYear\") % 100;\n    }, ord: function ord(a) {\n      a = U(a, \"Date\");return a + Pa(a);\n    }, tz: function tz(a) {\n      return a.getUTCOffset();\n    }, isotz: function isotz(a) {\n      return a.getUTCOffset(!0);\n    },\n    Z: function Z(a) {\n      return a.getUTCOffset();\n    }, ZZ: function ZZ(a) {\n      return a.getUTCOffset().replace(/(\\d{2})$/, \":$1\");\n    } },\n      Rb = [{ name: \"year\", method: \"FullYear\", k: !0, b: function b(a) {\n      return 864E5 * (365 + (a ? a.isLeapYear() ? 1 : 0 : 0.25));\n    } }, { name: \"month\", error: 0.919, method: \"Month\", k: !0, b: function b(a, _b) {\n      var c = 30.4375,\n          d;a && (d = a.daysInMonth(), _b <= d.days() && (c = d));return 864E5 * c;\n    } }, { name: \"week\", method: \"ISOWeek\", b: aa(6048E5) }, { name: \"day\", error: 0.958, method: \"Date\", k: !0, b: aa(864E5) }, { name: \"hour\", method: \"Hours\", b: aa(36E5) }, { name: \"minute\",\n    method: \"Minutes\", b: aa(6E4) }, { name: \"second\", method: \"Seconds\", b: aa(1E3) }, { name: \"millisecond\", method: \"Milliseconds\", b: aa(1) }],\n      Sb = {};function Tb(a) {\n    xa(this, a);this.g = Pb.concat();\n  }\n  Tb.prototype = { getMonth: function getMonth(a) {\n      return y(a) ? a - 1 : this.months.indexOf(a) % 12;\n    }, getWeekday: function getWeekday(a) {\n      return this.weekdays.indexOf(a) % 7;\n    }, addFormat: function addFormat(a, b, c, d, e) {\n      var g = c || [],\n          f = this,\n          h;a = a.replace(/\\s+/g, \"[,. ]*\");a = a.replace(/\\{([^,]+?)\\}/g, function (a, b) {\n        var d,\n            e,\n            h,\n            B = b.match(/\\?$/);h = b.match(/^(\\d+)\\??$/);var k = b.match(/(\\d)(?:-(\\d))?/),\n            E = b.replace(/[^a-z]+$/, \"\");h ? d = f.tokens[h[1]] : f[E] ? d = f[E] : f[E + \"s\"] && (d = f[E + \"s\"], k && (e = [], d.forEach(function (a, b) {\n          var c = b % (f.units ? 8 : d.length);c >= k[1] && c <= (k[2] || k[1]) && e.push(a);\n        }), d = e), d = Ub(d));h ? h = \"(?:\" + d + \")\" : (c || g.push(E), h = \"(\" + d + \")\");B && (h += \"?\");return h;\n      });b ? (b = Vb(f, e), e = [\"t\", \"[\\\\s\\\\u3000]\"].concat(f.timeMarker), h = a.match(/\\\\d\\{\\d,\\d\\}\\)+\\??$/), Wb(f, \"(?:\" + b + \")[,\\\\s\\\\u3000]+?\" + a, Jb.concat(g), d), Wb(f, a + \"(?:[,\\\\s]*(?:\" + e.join(\"|\") + (h ? \"+\" : \"*\") + \")\" + b + \")?\", g.concat(Jb), d)) : Wb(f, a, g, d);\n    } };\n  function Xb(a, b, c) {\n    var d,\n        e,\n        g = b[0],\n        f = b[1],\n        h = b[2];b = a[c] || a.relative;if (F(b)) return b.call(a, g, f, h, c);e = a.units[8 * (a.plural && 1 < g ? 1 : 0) + f] || a.units[f];a.capitalizeUnit && (e = Yb(e));d = a.modifiers.filter(function (a) {\n      return \"sign\" == a.name && a.value == (0 < h ? 1 : -1);\n    })[0];return b.replace(/\\{(.*?)\\}/g, function (a, b) {\n      switch (b) {case \"num\":\n          return g;case \"unit\":\n          return e;case \"sign\":\n          return d.src;}\n    });\n  }function Zb(a, b) {\n    b = b || a.code;return \"en\" === b || \"en-US\" === b ? !0 : a.variant;\n  }\n  function $b(a, b) {\n    return b.replace(q(a.num, \"g\"), function (b) {\n      return ac(a, b) || \"\";\n    });\n  }function ac(a, b) {\n    var c;return y(b) ? b : b && -1 !== (c = a.numbers.indexOf(b)) ? (c + 1) % 10 : 1;\n  }function Y(a, b) {\n    var c;z(a) || (a = \"\");c = Sb[a] || Sb[a.slice(0, 2)];if (!1 === b && !c) throw new TypeError(\"Invalid locale.\");return c || Ib;\n  }\n  function bc(a, b) {\n    function c(a) {\n      var b = h[a];z(b) ? h[a] = b.split(\",\") : b || (h[a] = []);\n    }function d(a, b) {\n      a = a.split(\"+\").map(function (a) {\n        return a.replace(/(.+):(.+)$/, function (a, b, c) {\n          return c.split(\"|\").map(function (a) {\n            return b + a;\n          }).join(\"|\");\n        });\n      }).join(\"|\");a.split(\"|\").forEach(b);\n    }function e(a, b, c) {\n      var e = [];h[a].forEach(function (a, f) {\n        b && (a += \"+\" + a.slice(0, 3));d(a, function (a, b) {\n          e[b * c + f] = a.toLowerCase();\n        });\n      });h[a] = e;\n    }function g(a, b, c) {\n      a = \"\\\\d{\" + a + \",\" + b + \"}\";c && (a += \"|(?:\" + Ub(h.numbers) + \")+\");return a;\n    }function f(a, b) {\n      h[a] = h[a] || b;\n    }var h, l;h = new Tb(b);c(\"modifiers\");\"months weekdays units numbers articles tokens timeMarker ampm timeSuffixes dateParse timeParse\".split(\" \").forEach(c);l = !h.monthSuffix;e(\"months\", l, 12);e(\"weekdays\", l, 7);e(\"units\", !1, 8);e(\"numbers\", !1, 10);f(\"code\", a);f(\"date\", g(1, 2, h.digitDate));f(\"year\", \"'\\\\d{2}|\" + g(4, 4));f(\"num\", function () {\n      var a = [\"-?\\\\d+\"].concat(h.articles);h.numbers && (a = a.concat(h.numbers));return Ub(a);\n    }());(function () {\n      var a = [];h.i = {};h.modifiers.push({ name: \"day\", src: \"yesterday\", value: -1 });\n      h.modifiers.push({ name: \"day\", src: \"today\", value: 0 });h.modifiers.push({ name: \"day\", src: \"tomorrow\", value: 1 });h.modifiers.forEach(function (b) {\n        var c = b.name;d(b.src, function (d) {\n          var e = h[c];h.i[d] = b;a.push({ name: c, src: d, value: b.value });h[c] = e ? e + \"|\" + d : d;\n        });\n      });h.day += \"|\" + Ub(h.weekdays);h.modifiers = a;\n    })();h.monthSuffix && (h.month = g(1, 2), h.months = \"1 2 3 4 5 6 7 8 9 10 11 12\".split(\" \").map(function (a) {\n      return a + h.monthSuffix;\n    }));h.full_month = g(1, 2) + \"|\" + Ub(h.months);0 < h.timeSuffixes.length && h.addFormat(Vb(h), !1, Jb);\n    h.addFormat(\"{day}\", !0);h.addFormat(\"{month}\" + (h.monthSuffix || \"\"));h.addFormat(\"{year}\" + (h.yearSuffix || \"\"));h.timeParse.forEach(function (a) {\n      h.addFormat(a, !0);\n    });h.dateParse.forEach(function (a) {\n      h.addFormat(a);\n    });return Sb[a] = h;\n  }function Wb(a, b, c, d) {\n    a.g.unshift({ r: d, locale: a, q: q(\"^\" + b + \"$\", \"i\"), to: c });\n  }function Yb(a) {\n    return a.slice(0, 1).toUpperCase() + a.slice(1);\n  }function Ub(a) {\n    return a.filter(function (a) {\n      return !!a;\n    }).join(\"|\");\n  }function cc() {\n    var a = r.SugarNewDate;return a ? a() : new r();\n  }\n  function dc(a, b) {\n    var c;if (G(a[0])) return a;if (y(a[0]) && !y(a[1])) return [a[0]];if (z(a[0]) && b) return [ec(a[0]), a[1]];c = {};Nb.forEach(function (b, e) {\n      c[b.name] = a[e];\n    });return [c];\n  }function ec(a) {\n    var b,\n        c = {};if (a = a.match(/^(\\d+)?\\s?(\\w+?)s?$/i)) N(b) && (b = parseInt(a[1]) || 1), c[a[2].toLowerCase()] = b;return c;\n  }function fc(a, b, c) {\n    var d;N(c) && (c = Ob.length);for (b = b || 0; b < c && (d = Ob[b], !1 !== a(d.name, d, b)); b++) {}\n  }\n  function gc(a, b) {\n    var c = {},\n        d,\n        e;b.forEach(function (b, f) {\n      d = a[f + 1];N(d) || \"\" === d || (\"year\" === b && (c.t = d.replace(/'/, \"\")), e = parseFloat(d.replace(/'/, \"\").replace(/,/, \".\")), c[b] = isNaN(e) ? d.toLowerCase() : e);\n    });return c;\n  }function hc(a) {\n    a = a.trim().replace(/^just (?=now)|\\.+$/i, \"\");return ic(a);\n  }\n  function ic(a) {\n    return a.replace(Mb, function (a, c, d) {\n      var e = 0,\n          g = 1,\n          f,\n          h;if (c) return a;d.split(\"\").reverse().forEach(function (a) {\n        a = Lb[a];var b = 9 < a;b ? (f && (e += g), g *= a / (h || 1), h = a) : (!1 === f && (g *= 10), e += g * a);f = b;\n      });f && (e += g);return e;\n    });\n  }\n  function jc(a, b, c, d) {\n    function e(a) {\n      vb.push(a);\n    }function g() {\n      vb.forEach(function (a) {\n        a.call();\n      });\n    }function f() {\n      var a = n.getWeekday();n.setWeekday(7 * (k.num - 1) + (a > Ba ? Ba + 7 : Ba));\n    }function h() {\n      var a = B.i[k.edge];fc(function (a) {\n        if (M(k[a])) return E = a, !1;\n      }, 4);if (\"year\" === E) k.e = \"month\";else if (\"month\" === E || \"week\" === E) k.e = \"day\";n[(0 > a.value ? \"endOf\" : \"beginningOf\") + Yb(E)]();-2 === a.value && n.reset();\n    }function l() {\n      var a;fc(function (b, c, d) {\n        \"day\" === b && (b = \"date\");if (M(k[b])) {\n          if (d >= wb) return n.setTime(NaN), !1;a = a || {};a[b] = k[b];\n          delete k[b];\n        }\n      });a && e(function () {\n        n.set(a, !0);\n      });\n    }var n, x, ha, vb, B, k, E, wb, Ba, ra, ca;n = cc();vb = [];n.utc(d);C(a) ? n.utc(a.isUTC()).setTime(a.getTime()) : y(a) ? n.setTime(a) : G(a) ? (n.set(a, !0), k = a) : z(a) && (ha = Y(b), a = hc(a), ha && I(ha.o ? [ha.o].concat(ha.g) : ha.g, function (c, d) {\n      var g = a.match(d.q);if (g) {\n        B = d.locale;k = gc(g, d.to);B.o = d;k.utc && n.utc();if (k.timestamp) return k = k.timestamp, !1;d.r && !z(k.month) && (z(k.date) || Zb(ha, b)) && (ca = k.month, k.month = k.date, k.date = ca);k.year && 2 === k.t.length && (k.year = 100 * R(U(cc(), \"FullYear\") / 100) - 100 * R(k.year / 100) + k.year);k.month && (k.month = B.getMonth(k.month), k.shift && !k.unit && (k.unit = B.units[7]));k.weekday && k.date ? delete k.weekday : k.weekday && (k.weekday = B.getWeekday(k.weekday), k.shift && !k.unit && (k.unit = B.units[5]));k.day && (ca = B.i[k.day]) ? (k.day = ca.value, n.reset(), x = !0) : k.day && -1 < (Ba = B.getWeekday(k.day)) && (delete k.day, k.num && k.month ? (e(f), k.day = 1) : k.weekday = Ba);k.date && !y(k.date) && (k.date = $b(B, k.date));k.ampm && k.ampm === B.ampm[1] && 12 > k.hour ? k.hour += 12 : k.ampm === B.ampm[0] && 12 === k.hour && (k.hour = 0);if (\"offset_hours\" in k || \"offset_minutes\" in k) n.utc(), k.offset_minutes = k.offset_minutes || 0, k.offset_minutes += 60 * k.offset_hours, \"-\" === k.offset_sign && (k.offset_minutes *= -1), k.minute -= k.offset_minutes;k.unit && (x = !0, ra = ac(B, k.num), wb = B.units.indexOf(k.unit) % 8, E = W.units[wb], l(), k.shift && (ra *= (ca = B.i[k.shift]) ? ca.value : 0), k.sign && (ca = B.i[k.sign]) && (ra *= ca.value), M(k.weekday) && (n.set({ weekday: k.weekday }, !0), delete k.weekday), k[E] = (k[E] || 0) + ra);k.edge && e(h);\"-\" === k.year_sign && (k.year *= -1);fc(function (a, b, c) {\n          b = k[a];var d = b % 1;d && (k[Ob[c - 1].name] = R(d * (\"second\" === a ? 1E3 : 60)), k[a] = Q(b));\n        }, 1, 4);return !1;\n      }\n    }), k ? x ? n.advance(k) : (n._utc && n.reset(), kc(n, k, !0, !1, c)) : (\"now\" !== a && (n = new r(a)), d && n.addMinutes(-n.getTimezoneOffset())), g(), n.utc(!1));return { c: n, set: k };\n  }function lc(a) {\n    var b,\n        c = P(a),\n        d = c,\n        e = 0;fc(function (a, f, h) {\n      b = Q(Da(c / f.b(), 1));1 <= b && (d = b, e = h);\n    }, 1);return [d, e, a];\n  }\n  function mc(a) {\n    var b = lc(a.millisecondsFromNow());if (6 === b[1] || 5 === b[1] && 4 === b[0] && a.daysFromNow() >= cc().daysInMonth()) b[0] = P(a.monthsFromNow()), b[1] = 6;return b;\n  }function nc(a, b, c) {\n    function d(a, c) {\n      var d = U(a, \"Month\");return Y(c).months[d + 12 * b];\n    }Z(a, d, c);Z(Yb(a), d, c, 1);\n  }function Z(a, b, c, d) {\n    X[a] = function (a, g) {\n      var f = b(a, g);c && (f = f.slice(0, c));d && (f = f.slice(0, d).toUpperCase() + f.slice(d));return f;\n    };\n  }\n  function oc(a, b, c) {\n    X[a] = b;X[a + a] = function (a, c) {\n      return T(b(a, c), 2);\n    };c && (X[a + a + a] = function (a, c) {\n      return T(b(a, c), 3);\n    }, X[a + a + a + a] = function (a, c) {\n      return T(b(a, c), 4);\n    });\n  }function pc(a) {\n    var b = a.match(/(\\{\\w+\\})|[^{}]+/g);Qb[a] = b.map(function (a) {\n      a.replace(/\\{(\\w+)\\}/, function (b, e) {\n        a = X[e] || e;return e;\n      });return a;\n    });\n  }\n  function qc(a, b, c, d) {\n    var e;if (!a.isValid()) return \"Invalid Date\";Date[b] ? b = Date[b] : F(b) && (e = mc(a), b = b.apply(a, e.concat(Y(d))));if (!b && c) return e = e || mc(a), 0 === e[1] && (e[1] = 1, e[0] = 1), a = Y(d), Xb(a, e, 0 < e[2] ? \"future\" : \"past\");b = b || \"long\";if (\"short\" === b || \"long\" === b || \"full\" === b) b = Y(d)[b];Qb[b] || pc(b);var g, f;e = \"\";b = Qb[b];g = 0;for (c = b.length; g < c; g++) {\n      f = b[g], e += F(f) ? f(a, d) : f;\n    }return e;\n  }\n  function rc(a, b, c, d, e) {\n    var g,\n        f,\n        h,\n        l = 0,\n        n = 0,\n        x = 0;g = jc(b, c, null, e);0 < d && (n = x = d, f = !0);if (!g.c.isValid()) return !1;if (g.set && g.set.e) {\n      Rb.forEach(function (b) {\n        b.name === g.set.e && (l = b.b(g.c, a - g.c) - 1);\n      });b = Yb(g.set.e);if (g.set.edge || g.set.shift) g.c[\"beginningOf\" + b]();\"month\" === g.set.e && (h = g.c.clone()[\"endOf\" + b]().getTime());!f && g.set.sign && \"millisecond\" != g.set.e && (n = 50, x = -50);\n    }f = a.getTime();b = g.c.getTime();h = sc(a, b, h || b + l);return f >= b - n && f <= h + x;\n  }\n  function sc(a, b, c) {\n    b = new r(b);a = new r(c).utc(a.isUTC());23 !== U(a, \"Hours\") && (b = b.getTimezoneOffset(), a = a.getTimezoneOffset(), b !== a && (c += (a - b).minutes()));return c;\n  }\n  function kc(a, b, c, d, e) {\n    function g(a) {\n      return M(b[a]) ? b[a] : b[a + \"s\"];\n    }function f(a) {\n      return M(g(a));\n    }var h;if (y(b) && d) b = { milliseconds: b };else if (y(b)) return a.setTime(b), a;M(b.date) && (b.day = b.date);fc(function (d, e, g) {\n      var l = \"day\" === d;if (f(d) || l && f(\"weekday\")) return b.e = d, h = +g, !1;!c || \"week\" === d || l && f(\"week\") || Sa(a, e.method, l ? 1 : 0);\n    });Rb.forEach(function (c) {\n      var e = c.name;c = c.method;var h;h = g(e);N(h) || (d ? (\"week\" === e && (h = (b.day || 0) + 7 * h, c = \"Date\"), h = h * d + U(a, c)) : \"month\" === e && f(\"day\") && Sa(a, \"Date\", 15), Sa(a, c, h), d && \"month\" === e && (e = h, 0 > e && (e = e % 12 + 12), e % 12 != U(a, \"Month\") && Sa(a, \"Date\", 0)));\n    });d || f(\"day\") || !f(\"weekday\") || a.setWeekday(g(\"weekday\"));var l;a: {\n      switch (e) {case -1:\n          l = a > cc();break a;case 1:\n          l = a < cc();break a;}l = void 0;\n    }l && fc(function (b, c) {\n      if ((c.k || \"week\" === b && f(\"weekday\")) && !(f(b) || \"day\" === b && f(\"weekday\"))) return a[c.j](e), !1;\n    }, h + 1);return a;\n  }\n  function Vb(a, b) {\n    var c = Kb,\n        d = { h: 0, m: 1, s: 2 },\n        e;a = a || W;return c.replace(/{([a-z])}/g, function (c, f) {\n      var h = [],\n          l = \"h\" === f,\n          n = l && !b;if (\"t\" === f) return a.ampm.join(\"|\");l && h.push(\":\");(e = a.timeSuffixes[d[f]]) && h.push(e + \"\\\\s*\");return 0 === h.length ? \"\" : \"(?:\" + h.join(\"|\") + \")\" + (n ? \"\" : \"?\");\n    });\n  }function tc(a, b, c) {\n    var d, e;y(a[1]) ? d = dc(a)[0] : (d = a[0], e = a[1]);return jc(d, e, b, c).c;\n  }\n  H(r, !1, !0, { create: function create() {\n      return tc(arguments);\n    }, past: function past() {\n      return tc(arguments, -1);\n    }, future: function future() {\n      return tc(arguments, 1);\n    }, addLocale: function addLocale(a, b) {\n      return bc(a, b);\n    }, setLocale: function setLocale(a) {\n      var b = Y(a, !1);Ib = b;a && a != b.code && (b.code = a);return b;\n    }, getLocale: function getLocale(a) {\n      return a ? Y(a, !1) : Ib;\n    }, addFormat: function addFormat(a, b, c) {\n      Wb(Y(c), a, b);\n    } });\n  H(r, !0, !0, { set: function set() {\n      var a = dc(arguments);return kc(this, a[0], a[1]);\n    }, setWeekday: function setWeekday(a) {\n      if (!N(a)) return Sa(this, \"Date\", U(this, \"Date\") + a - U(this, \"Day\"));\n    }, setISOWeek: function setISOWeek(a) {\n      var b = U(this, \"Day\") || 7;if (!N(a)) return this.set({ month: 0, date: 4 }), this.set({ weekday: 1 }), 1 < a && this.addWeeks(a - 1), 1 !== b && this.advance({ days: b - 1 }), this.getTime();\n    }, getISOWeek: function getISOWeek() {\n      var a;a = this.clone();var b = U(a, \"Day\") || 7;a.addDays(4 - b).reset();return 1 + Q(a.daysSince(a.clone().beginningOfYear()) / 7);\n    }, beginningOfISOWeek: function beginningOfISOWeek() {\n      var a = this.getDay();0 === a ? a = -6 : 1 !== a && (a = 1);this.setWeekday(a);return this.reset();\n    }, endOfISOWeek: function endOfISOWeek() {\n      0 !== this.getDay() && this.setWeekday(7);return this.endOfDay();\n    }, getUTCOffset: function getUTCOffset(a) {\n      var b = this._utc ? 0 : this.getTimezoneOffset(),\n          c = !0 === a ? \":\" : \"\";return !b && a ? \"Z\" : T(Q(-b / 60), 2, !0) + c + T(P(b % 60), 2);\n    }, utc: function utc(a) {\n      oa(this, \"_utc\", !0 === a || 0 === arguments.length);return this;\n    }, isUTC: function isUTC() {\n      return !!this._utc || 0 === this.getTimezoneOffset();\n    }, advance: function advance() {\n      var a = dc(arguments, !0);return kc(this, a[0], a[1], 1);\n    }, rewind: function rewind() {\n      var a = dc(arguments, !0);return kc(this, a[0], a[1], -1);\n    }, isValid: function isValid() {\n      return !isNaN(this.getTime());\n    }, isAfter: function isAfter(a, b) {\n      return this.getTime() > r.create(a).getTime() - (b || 0);\n    }, isBefore: function isBefore(a, b) {\n      return this.getTime() < r.create(a).getTime() + (b || 0);\n    }, isBetween: function isBetween(a, b, c) {\n      var d = this.getTime();a = r.create(a).getTime();var e = r.create(b).getTime();b = Ca(a, e);a = S(a, e);c = c || 0;return b - c < d && a + c > d;\n    }, isLeapYear: function isLeapYear() {\n      var a = U(this, \"FullYear\");return 0 === a % 4 && 0 !== a % 100 || 0 === a % 400;\n    },\n    daysInMonth: function daysInMonth() {\n      return 32 - U(new r(U(this, \"FullYear\"), U(this, \"Month\"), 32), \"Date\");\n    }, format: function format(a, b) {\n      return qc(this, a, !1, b);\n    }, relative: function relative(a, b) {\n      z(a) && (b = a, a = null);return qc(this, a, !0, b);\n    }, is: function is(a, b, c) {\n      var d, e;if (this.isValid()) {\n        if (z(a)) switch (a = a.trim().toLowerCase(), e = this.clone().utc(c), !0) {case \"future\" === a:\n            return this.getTime() > cc().getTime();case \"past\" === a:\n            return this.getTime() < cc().getTime();case \"weekday\" === a:\n            return 0 < U(e, \"Day\") && 6 > U(e, \"Day\");case \"weekend\" === a:\n            return 0 === U(e, \"Day\") || 6 === U(e, \"Day\");case -1 < (d = W.weekdays.indexOf(a) % 7):\n            return U(e, \"Day\") === d;case -1 < (d = W.months.indexOf(a) % 12):\n            return U(e, \"Month\") === d;}return rc(this, a, null, b, c);\n      }\n    }, reset: function reset(a) {\n      var b = {},\n          c;a = a || \"hours\";\"date\" === a && (a = \"days\");c = Rb.some(function (b) {\n        return a === b.name || a === b.name + \"s\";\n      });b[a] = a.match(/^days?/) ? 1 : 0;return c ? this.set(b, !0) : this;\n    }, clone: function clone() {\n      var a = new r(this.getTime());a.utc(!!this._utc);return a;\n    } });\n  H(r, !0, !0, { iso: function iso() {\n      return this.toISOString();\n    }, getWeekday: r.prototype.getDay, getUTCWeekday: r.prototype.getUTCDay });function uc(a, b) {\n    function c() {\n      return R(this * b);\n    }function d() {\n      return tc(arguments)[a.j](this);\n    }function e() {\n      return tc(arguments)[a.j](-this);\n    }var g = a.name,\n        f = {};f[g] = c;f[g + \"s\"] = c;f[g + \"Before\"] = e;f[g + \"sBefore\"] = e;f[g + \"Ago\"] = e;f[g + \"sAgo\"] = e;f[g + \"After\"] = d;f[g + \"sAfter\"] = d;f[g + \"FromNow\"] = d;f[g + \"sFromNow\"] = d;t.extend(f);\n  }H(t, !0, !0, { duration: function duration(a) {\n      a = Y(a);return Xb(a, lc(this), \"duration\");\n    } });\n  W = Ib = r.addLocale(\"en\", { plural: !0, timeMarker: \"at\", ampm: \"am,pm\", months: \"January,February,March,April,May,June,July,August,September,October,November,December\", weekdays: \"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\", units: \"millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s\", numbers: \"one,two,three,four,five,six,seven,eight,nine,ten\", articles: \"a,an,the\", tokens: \"the,st|nd|rd|th,of\", \"short\": \"{Month} {d}, {yyyy}\", \"long\": \"{Month} {d}, {yyyy} {h}:{mm}{tt}\", full: \"{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}\",\n    past: \"{num} {unit} {sign}\", future: \"{num} {unit} {sign}\", duration: \"{num} {unit}\", modifiers: [{ name: \"sign\", src: \"ago|before\", value: -1 }, { name: \"sign\", src: \"from now|after|from|in|later\", value: 1 }, { name: \"edge\", src: \"last day\", value: -2 }, { name: \"edge\", src: \"end\", value: -1 }, { name: \"edge\", src: \"first day|beginning\", value: 1 }, { name: \"shift\", src: \"last\", value: -1 }, { name: \"shift\", src: \"the|this\", value: 0 }, { name: \"shift\", src: \"next\", value: 1 }], dateParse: [\"{month} {year}\", \"{shift} {unit=5-7}\", \"{0?} {date}{1}\", \"{0?} {edge} of {shift?} {unit=4-7?}{month?}{year?}\"],\n    timeParse: \"{num} {unit} {sign};{sign} {num} {unit};{0} {num}{1} {day} of {month} {year?};{weekday?} {month} {date}{1?} {year?};{date} {month} {year};{date} {month};{shift} {weekday};{shift} week {weekday};{weekday} {2?} {shift} week;{num} {unit=4-5} {sign} {day};{0?} {date}{1} of {month};{0?}{month?} {date?}{1?} of {shift} {unit=6-7}\".split(\";\") });Ob = Rb.concat().reverse();Nb = Rb.concat();Nb.splice(2, 1);\n  K(r, !0, !0, Rb, function (a, b, c) {\n    function d(a) {\n      a /= f;var c = a % 1,\n          d = b.error || 0.999;c && P(c % 1) > d && (a = R(a));return 0 > a ? Aa(a) : Q(a);\n    }var e = b.name,\n        g = Yb(e),\n        f = b.b(),\n        h,\n        l;b.j = \"add\" + g + \"s\";h = function h(a, b) {\n      return d(this.getTime() - r.create(a, b).getTime());\n    };l = function l(a, b) {\n      return d(r.create(a, b).getTime() - this.getTime());\n    };a[e + \"sAgo\"] = l;a[e + \"sUntil\"] = l;a[e + \"sSince\"] = h;a[e + \"sFromNow\"] = h;a[b.j] = function (a, b) {\n      var c = {};c[e] = a;return this.advance(c, b);\n    };uc(b, f);3 > c && [\"Last\", \"This\", \"Next\"].forEach(function (b) {\n      a[\"is\" + b + g] = function () {\n        return rc(this, b + \" \" + e, \"en\");\n      };\n    });4 > c && (a[\"beginningOf\" + g] = function () {\n      var a = {};switch (e) {case \"year\":\n          a.year = U(this, \"FullYear\");break;case \"month\":\n          a.month = U(this, \"Month\");break;case \"day\":\n          a.day = U(this, \"Date\");break;case \"week\":\n          a.weekday = 0;}return this.set(a, !0);\n    }, a[\"endOf\" + g] = function () {\n      var a = { hours: 23, minutes: 59, seconds: 59, milliseconds: 999 };switch (e) {case \"year\":\n          a.month = 11;a.day = 31;break;case \"month\":\n          a.day = this.daysInMonth();break;case \"week\":\n          a.weekday = 6;}return this.set(a, !0);\n    });\n  });\n  W.addFormat(\"([+-])?(\\\\d{4,4})[-.]?{full_month}[-.]?(\\\\d{1,2})?\", !0, [\"year_sign\", \"year\", \"month\", \"date\"], !1, !0);W.addFormat(\"(\\\\d{1,2})[-.\\\\/]{full_month}(?:[-.\\\\/](\\\\d{2,4}))?\", !0, [\"date\", \"month\", \"year\"], !0);W.addFormat(\"{full_month}[-.](\\\\d{4,4})\", !1, [\"month\", \"year\"]);W.addFormat(\"\\\\/Date\\\\((\\\\d+(?:[+-]\\\\d{4,4})?)\\\\)\\\\/\", !1, [\"timestamp\"]);W.addFormat(Vb(W), !1, Jb);Pb = W.g.slice(0, 7).reverse();W.g = W.g.slice(7).concat(Pb);oc(\"f\", function (a) {\n    return U(a, \"Milliseconds\");\n  }, !0);\n  oc(\"s\", function (a) {\n    return U(a, \"Seconds\");\n  });oc(\"m\", function (a) {\n    return U(a, \"Minutes\");\n  });oc(\"h\", function (a) {\n    return U(a, \"Hours\") % 12 || 12;\n  });oc(\"H\", function (a) {\n    return U(a, \"Hours\");\n  });oc(\"d\", function (a) {\n    return U(a, \"Date\");\n  });oc(\"M\", function (a) {\n    return U(a, \"Month\") + 1;\n  });(function () {\n    function a(a, c) {\n      var d = U(a, \"Hours\");return Y(c).ampm[Q(d / 12)] || \"\";\n    }Z(\"t\", a, 1);Z(\"tt\", a);Z(\"T\", a, 1, 1);Z(\"TT\", a, null, 2);\n  })();\n  /* istanbul ignore next */\n  (function () {\n    function a(a, c) {\n      var d = U(a, \"Day\");return Y(c).weekdays[d];\n    }Z(\"dow\", a, 3);Z(\"Dow\", a, 3, 1);Z(\"weekday\", a);Z(\"Weekday\", a, null, 1);\n  })();nc(\"mon\", 0, 3);nc(\"month\", 0);nc(\"month2\", 1);nc(\"month3\", 2);X.ms = X.f;X.milliseconds = X.f;X.seconds = X.s;X.minutes = X.m;X.hours = X.h;X[\"24hr\"] = X.H;X[\"12hr\"] = X.h;X.date = X.d;X.day = X.d;X.year = X.yyyy;K(r, !0, !0, \"short,long,full\", function (a, b) {\n    a[b] = function (a) {\n      return qc(this, b, !1, a);\n    };\n  });\n  \"〇一二三四五六七八九十百千万\".split(\"\").forEach(function (a, b) {\n    9 < b && (b = za(10, b - 9));Lb[a] = b;\n  });xa(Lb, Ka);Mb = q(\"([期週周])?([〇一二三四五六七八九十百千万\" + Ja + \"]+)(?!昨)\", \"g\");\n  /* istanbul ignore next */\n  (function () {\n    var a = W.weekdays.slice(0, 7),\n        b = W.months.slice(0, 12);K(r, !0, !0, \"today yesterday tomorrow weekday weekend future past\".split(\" \").concat(a).concat(b), function (a, b) {\n      a[\"is\" + Yb(b)] = function (a) {\n        return this.is(b, 0, a);\n      };\n    });\n  })();r.utc || (r.utc = { create: function create() {\n      return tc(arguments, 0, !0);\n    }, past: function past() {\n      return tc(arguments, -1, !0);\n    }, future: function future() {\n      return tc(arguments, 1, !0);\n    } });\n  H(r, !1, !0, { RFC1123: \"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}\", RFC1036: \"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}\", ISO8601_DATE: \"{yyyy}-{MM}-{dd}\", ISO8601_DATETIME: \"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}\" });\n})();"
  },
  {
    "path": "packages/touch/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/touch/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/touch/package.json",
    "content": "{\n  \"name\": \"cash-touch\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Cross-platform implementation of the Unix 'touch' command.\",\n  \"main\": \"./dist/commands/touch.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"touch\": \"./bin/touch.js\"\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.0.0\",\n    \"fs-extra\": \"^0.26.7\",\n    \"vorpal-autocomplete-fs\": \"0.0.3\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.11.16\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/true/README.md",
    "content": "# cash-true\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `true` command.\n\n```bash\nnpm install cash-true -g\n```\n\nThis will install `true` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> true --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/true/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/true/bin/true.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'true');\n"
  },
  {
    "path": "packages/true/dist/commands/true.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\n\nvar _true = {\n  exec: function exec() {\n    // Always return 0\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _true;\n  }\n  vorpal.api.true = _true;\n  vorpal.command('true').action(function (args, callback) {\n    return interfacer.call(this, {\n      command: _true,\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/true/dist/help/true.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: true [OPTION]\\nDo nothing, successfully\\n\\nThis command simply exits with status 0 (success).\\n\\n      --help   display this help and exit\\n\\nReport true bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/true/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/true/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/true/package.json",
    "content": "{\n  \"name\": \"cash-true\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Cross-platform implementation of the Unix 'true' command.\",\n  \"main\": \"./dist/commands/true.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"true\": \"./bin/true.js\"\n  },\n  \"dependencies\": {\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "packages/which/README.md",
    "content": "# cash-which\n\n---\n\n\nThis is a cross-platform, 100% ES6 implementation of the Unix `which` command.\n\n```bash\nnpm install cash-which -g\n```\n\nThis will install `which` globally in your system path.\n\nFor help on the command, type:\n\n```bash\n> which --help\n```\n\n## More\n\nThis module is part of [Cash](https://github.com/dthree/cash), a project providing cross-platform implementations of all major Unix-based commands in pure Javascript.\n\n\n## Related\n\n- [cash](https://github.com/dthree/cash) - Main project\n- [cash-global](https://npmjs.com/package/cash-global) - Globally install all commands\n- [vorpal](https://github.com/dthree/vorpal) - Cash is built on Vorpal\n\n#### Individual commands\n\n- [cash-cat](https://npmjs.com/package/cash-cat)\n- [cash-cp](https://npmjs.com/package/cash-cp)\n- [cash-false](https://npmjs.com/package/cash-false)\n- [cash-head](https://npmjs.com/package/cash-head)\n- [cash-kill](https://npmjs.com/package/cash-kill)\n- [cash-ls](https://npmjs.com/package/cash-ls)\n- [cash-mkdir](https://npmjs.com/package/cash-mkdir)\n- [cash-mv](https://npmjs.com/package/cash-mv)\n- [cash-pwd](https://npmjs.com/package/cash-pwd)\n- [cash-sort](https://npmjs.com/package/cash-sort)\n- [cash-tail](https://npmjs.com/package/cash-tail)\n- [cash-touch](https://npmjs.com/package/cash-touch)\n- [cash-true](https://npmjs.com/package/cash-true)\n- [cash-rm](https://npmjs.com/package/cash-rm)\n- [cash-which](https://npmjs.com/package/cash-which)\n\n\n## License\n\nMIT © [David Caccavella](https://github.com/dthree)\n"
  },
  {
    "path": "packages/which/bin/parser.js",
    "content": "'use strict';\n\nmodule.exports = function (args, command) {\n  args.splice(0, 2);\n  var pipes = (args.indexOf('|') > -1);\n  if (args.length === 0) {\n    // If we don't have to parse arguments, do\n    // the quickest load: just the raw js file\n    // of the command and nothing else.\n    var cmd = require('./../dist/commands/' + command)();\n    cmd.exec.call(console, {options: {}}, {});\n  } else if (pipes === false) {\n    // If we need to parse args for this\n    // command only, pull up vorpal and just load\n    // that one command.\n    var vorpal = require('vorpal')();\n    vorpal.api = {};\n    require('./../dist/commands/' + command)(vorpal);\n    args = args.join(' ');\n\n    // If we passed in a help request, load in\n    // the help file.\n    if (args.indexOf('help') > -1 || args.indexOf('?') > -1) {\n      let help;\n      try {\n        help = require('./../dist/help/' + command + '.js');\n        help = String(help).replace(/^\\n|\\n$/g, '');\n      } catch (e) {}\n      let cmdObj = vorpal.find(command);\n      if (cmdObj && help) {\n        cmdObj.help(function (argus, cb) {\n          cb(help);\n        })\n      }\n    }\n    vorpal.exec(command + ' ' + args);\n  } else {\n    // If we get into piping other commands,\n    // we need to go full bore and load the\n    // entire cash library.\n    // I guess we could technically parse all\n    // of the passed args, look for applicable\n    // commands and only load those, but that's\n    // some messy work for something that might\n    // not matter. If you're reading this and\n    // have deemed it matters, do a PR.\n    var cash = require('./../dist/index');\n    cash.vorpal.exec(command + ' ' + args.join(' '));\n  }\n};\n"
  },
  {
    "path": "packages/which/bin/which.js",
    "content": "#!/usr/bin/env node\nrequire('./parser')(process.argv, 'which');\n"
  },
  {
    "path": "packages/which/dist/commands/which.js",
    "content": "'use strict';\n\nvar interfacer = require('./../util/interfacer');\nvar preparser = require('./../preparser');\n\nvar which = {\n  exec: function exec(args, options) {\n    options = options || {};\n\n    var command = (args instanceof Array ? args : [args]).join(' ');\n    if (command.length <= 0) {\n      return 0;\n    }\n    try {\n      this.log(require('which').sync(command));\n      return 0;\n    } catch (error) {\n      this.log(error);\n      return 1;\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return which;\n  }\n  vorpal.api.which = which;\n\n  vorpal.command('which [command]').parse(preparser).action(function (args, callback) {\n    return interfacer.call(this, {\n      command: which,\n      args: args.command,\n      options: {},\n      callback: callback\n    });\n  });\n};"
  },
  {
    "path": "packages/which/dist/help/which.js",
    "content": "\"use strict\";\n\nmodule.exports = \"\\nUsage: which COMMAND\\nLook for COMMAND in $PATH.\\n\\n      --help                   display this help and exit\\n\\nReport which bugs to <https://github.com/dthree/cash>\\nCash home page: <http://cash.js.org/>\\n\";"
  },
  {
    "path": "packages/which/dist/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\n\nvar parseEnvVariables = function parseEnvVariables(input) {\n  var referenceRegex = /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    var varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nvar preparser = function preparser(input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;"
  },
  {
    "path": "packages/which/dist/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  var self = this;\n  var stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {\n    exec: function exec() {}\n  };\n\n  var logger = {\n    log: function log(out) {\n      stdout += out + '\\n';\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = result === undefined ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};"
  },
  {
    "path": "packages/which/package.json",
    "content": "{\n  \"name\": \"cash-which\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Cross-platform implementation of the Unix 'which' command.\",\n  \"main\": \"./dist/commands/which.js\",\n  \"scripts\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dthree/cash.git\"\n  },\n  \"keywords\": [\n    \"cash\",\n    \"terminal\",\n    \"emulator\",\n    \"cygwin\",\n    \"cli\",\n    \"windows\",\n    \"linux\",\n    \"unix\",\n    \"posix\",\n    \"bash\",\n    \"tty\",\n    \"util\",\n    \"vorpal\",\n    \"vorpal.js\"\n  ],\n  \"author\": \"dthree\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dthree/cash/issues\"\n  },\n  \"homepage\": \"https://github.com/dthree/cash#readme\",\n  \"devDependencies\": {},\n  \"bin\": {\n    \"which\": \"./bin/which.js\"\n  },\n  \"dependencies\": {\n    \"which\": \"^1.2.4\",\n    \"vorpal\": \"^1.10.8\"\n  },\n  \"engines\": {\n    \"node\": \">= 4\",\n    \"iojs\": \">= 1.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"bin\"\n  ]\n}\n"
  },
  {
    "path": "src/commands/alias.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst alias = {\n\n  exec(args, options) {\n    args = args || [];\n    options = options || {};\n    const vorpal = options.vorpal;\n\n    if (!vorpal) {\n      throw new Error('Alias is not programatically supported.');\n    }\n\n    vorpal._aliases = vorpal._aliases || [];\n\n    if (args.length < 1) {\n      options.p = true;\n    }\n\n    if (typeof args === 'string' || args instanceof String) {\n      args = [args];\n    }\n\n    // Parse incoming args. Accept either:\n    // alias foo=bar, or\n    // alias foo 'bar and so on'.\n    let key = args.join(' ');\n    let value;\n    if (String(key).indexOf('=') > -1) {\n      const parts = String(key).trim().split('=');\n      key = parts[0];\n      value = parts[1] || value;\n    } else {\n      const parts = String(key).trim().split(' ');\n      key = parts.shift();\n      value = parts.join(' ');\n    }\n\n    // Remove wrapped quotes from value.\n    if (value !== undefined) {\n      value = String(value).replace(/^[\\\"|\\']|[\\\"|\\']$/g, '');\n    }\n\n    // Pull list of aliases\n    let all;\n    try {\n      all = JSON.parse(vorpal.localStorage.getItem('aliases') || []);\n    } catch (e) {\n      all = [];\n      vorpal.localStorage.removeItem('aliases');\n    }\n\n    if (options.p) {\n      for (let i = 0; i < all.length; ++i) {\n        const item = vorpal.localStorage.getItem(`alias|${all[i]}`);\n        if (item !== undefined && item !== null) {\n          this.log(`alias ${all[i]}='${item}'`);\n        }\n      }\n    } else {\n      if (value) {\n        vorpal.localStorage.setItem(`alias|${key}`, value);\n        all = all.filter(function (val) {\n          return val !== key;\n        });\n        all.push(key);\n      } else {\n        const item = vorpal.localStorage.getItem(`alias|${key}`);\n        if (item !== undefined && item !== null) {\n          this.log(`alias ${key}='${item}'`);\n        } else {\n          this.log(`-cash: alias: ${key}: not found`);\n        }\n      }\n\n      const aliases = {};\n      for (let i = 0; i < all.length; ++i) {\n        const item = vorpal.localStorage.getItem(`alias|${all[i]}`);\n        if (item !== undefined && item !== null) {\n          aliases[all[i]] = item;\n        }\n      }\n      vorpal._aliases = aliases;\n    }\n\n    vorpal.localStorage.setItem('aliases', JSON.stringify(all));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return alias;\n  }\n  vorpal.api.alias = alias;\n  vorpal\n    .command('alias [name...]')\n    .parse(preparser)\n    .option('-p', 'print all defined aliases in a reusable format')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      args.options.vorpal = vorpal;\n      return interfacer.call(this, {\n        command: alias,\n        args: args.name,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/boilerplate.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\n/**\n * This is a boilerplate for implementing a new command.\n * Delete all of these comments / instructions before finishing.\n */\n\n/**\n * 0. Replace all instances of `cmdName` with\n *    the exact name of the command being implemented.\n */\n\nconst cmdName = {\n\n  /**\n   * The cmdName.exec method is exposed by Cash\n   * as the only public interfacer to your command.\n   */\n\n  exec(args, options) {\n    options = options || {};\n\n    /**\n     * 1. Validate arg input to include every\n     *    possible form of input, such as:\n     *\n     *    a. as a string:\n     *       cash.foo('bar and so on', {option: true});\n     *\n     *    b. as an array:\n     *       cash.foo(['bar', 'and', 'so', 'on'], {option: true});\n     *\n     *    c. as interpeted through Vorpal:\n     *       cash('foo bar and so on --option');\n     */\n\n    /**\n     * 2. For errors, use `this.log` to print the\n     *    error message to the user, and only return\n     *    the error code (1, 2, etc.)\n     *\n     *    if (args.length < 1) {\n     *      this.log('foo: cannot bar: requires at least one file name');\n     *      return 1;\n     *    }\n     */\n\n    /**\n     * 3. For all other stdout to the user, use `this.log`.\n     *    For large jobs that should stream logging a\n     *    bit at a time, use multiple `this.log` statements\n     *    and cash will handle the heavy lifting of piping\n     *    and returning the final assembled output to the\n     *    user in the case of programmatically executed\n     *    commands.\n     */\n\n    /**\n     * 4. When complete with no errors, return 0;\n     *\n     *    return 0;\n     */\n  }\n};\n\nmodule.exports = function (vorpal) {\n  /**\n   * When do a raw execution of the command\n   * without options, Vorpal is not used. In this\n   * case, the raw command is returned.\n   */\n  if (vorpal === undefined) {\n    return cmdName;\n  }\n  vorpal.api.cmdName = cmdName;\n  /**\n   * Registers the command in Vorpal.\n   * Command strings, options and their\n   * descriptions should exactly emulate\n   * existing commands.\n   */\n  vorpal\n    .command('cmdName [files...]')\n    .parse(preparser)\n    .option('-o, --option', 'option description')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      /**\n       * The interfacer method does a\n       * lot of heavy lifting on interfacing with\n       * the command properly.\n       */\n      return interfacer.call(this, {\n        command: cmdName,\n        args: args.files, // only pass in what you need from Vorpal\n        options: args.options, // split the options into their own arg\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/cat.js",
    "content": "'use strict';\n\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst fetch = require('./../util/fetch');\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\nconst lpad = require('./../util/lpad');\nconst strip = require('./../util/stripAnsi');\n\nconst cat = {\n\n  exec(args, options) {\n    const self = this;\n\n    // Input normalization\n    if (args === undefined) {\n      args = {\n        files: []\n      };\n    } else if (typeof args === 'string' || args instanceof String) {\n      args = {\n        files: [args]\n      };\n    } else if (Array.isArray(args)) {\n      args = {\n        files: args\n      };\n    }\n\n    options = options || {};\n\n    // -A handler\n    if (options.showall) {\n      options.shownonprinting = true;\n      options.showends = true;\n      options.showtabs = true;\n    }\n\n    // -e handler\n    if (options.e) {\n      options.shownonprinting = true;\n      options.showends = true;\n    }\n\n    // -t handler\n    if (options.t) {\n      options.shownonprinting = true;\n      options.showtabs = true;\n    }\n\n    let stdout = '';\n    try {\n      const stdin = fetch(args.files, args.stdin, {\n        onDirectory(name) {\n          return `cat: ${name}: Is a directory`;\n        },\n        onInvalidFile(name) {\n          return `cat: ${name}: No such file or directory`;\n        }\n      });\n      let ctr = 0;\n      for (let i = 0; i < stdin.length; ++i) {\n        // If -s, squeeze double blank lines to a\n        // single line.\n        if (options.squeezeblank) {\n          stdin[i] = stdin[i].replace(/\\n\\n\\s*\\n/g, '\\n\\n');\n        }\n        if (options.showtabs) {\n          stdin[i] = stdin[i].replace(/\\t/g, '^I');\n        }\n        // Get rid of trailing line break because\n        // node logging does it anyway.\n        stdin[i] = stdin[i].replace(/\\s$/, '');\n        const parts = String(stdin[i]).split('\\n');\n        for (let j = 0; j < parts.length; ++j) {\n          const blank = ((strip(parts[j])).trim() === '');\n          // If -b, number every non-blank line\n          // If -n, number every line\n          const numbered = ((!blank && options.numbernonblank) || (options.number && !options.numbernonblank));\n          if (numbered) {\n            ctr++;\n          }\n          const numStr = (numbered) ?\n              `${lpad(String(ctr), 6, ' ')}  ` :\n              '';\n          // If -E, append a $ to each line end.\n          const dollarStr = (options.showends) ? '$' : '';\n          const line =\n              numStr +\n              parts[j] +\n              dollarStr;\n          stdout += `${line}\\n`;\n        }\n      }\n\n      if (stdout.length > 0) {\n        self.log(stdout.slice(0, stdout.length - 1));\n      }\n\n      return 0;\n    } catch (e) {\n      /* istanbul ignore next */\n      self.log(e.stack);\n      /* istanbul ignore next */\n      return 1;\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cat;\n  }\n  vorpal.api.cat = cat;\n  vorpal\n      .command('cat [files...]')\n      .parse(preparser)\n      .option('-A, --show-all', 'equivalent to -vET')\n      .option('-b, --number-nonblank', 'number nonempty output lines, overrides -n')\n      .option('-e', 'equivalent to -vE')\n      .option('-E, --show-ends', 'display $ at end of each line')\n      .option('-n, --number', 'number all output lines')\n      .option('-s, --squeeze-blank', 'suppress repeated empty output lines')\n      .option('-t', 'equivalent to -vT')\n      .option('-T, --show-tabs', 'display TAB characters as ^I')\n      .option('-v, --show-nonprinting', 'use ^ and M- notation, except for LFD and TAB') // this doesn't work yet...\n      .autocomplete(fsAutocomplete())\n      .action(function (args, cb) {\n        args.options = args.options || {};\n        return interfacer.call(this, {\n          command: cat,\n          args,\n          options: args.options,\n          callback: cb\n        });\n      });\n};\n"
  },
  {
    "path": "src/commands/cd.js",
    "content": "'use strict';\n\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\nconst delimiter = require('./../delimiter');\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst cd = {\n\n  exec(dir, options) {\n    const self = this;\n    const vpl = options.vorpal;\n    options = options || {};\n\n    dir = (!dir) ? delimiter.getHomeDir() : dir;\n\n    // Allow Windows drive letter changes\n    dir = (dir && dir.length === 2 && dir[1] === '/') ? `${dir[0]}:` : dir;\n\n    try {\n      process.chdir(dir);\n      if (vpl) {\n        delimiter.refresh(vpl);\n      }\n      return 0;\n    } catch (e) {\n      return cd.error.call(self, e, dir);\n    }\n  },\n\n  error(e, dir) {\n    let status;\n    let stdout;\n    if (e.code === 'ENOENT' && e.syscall === 'uv_chdir') {\n      status = 1;\n      stdout = `-bash: cd: ${dir}: No such file or directory`;\n    } else {\n      status = 2;\n      stdout = e.stack;\n    }\n    this.log(stdout);\n    return status;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cd;\n  }\n  vorpal.api.cd = cd;\n  vorpal\n    .command('cd [dir]')\n    .parse(preparser)\n    .autocomplete(fsAutocomplete({directory: true}))\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      args.options.vorpal = vorpal;\n      return interfacer.call(this, {\n        command: cd,\n        args: args.dir,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/clear.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\n\nconst clear = {\n  exec() {\n    this.log('\\u001b[2J\\u001b[0;0H');\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return clear;\n  }\n  vorpal.api.clear = clear;\n  vorpal\n    .command('clear')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: clear,\n        args,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/cp.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\nconst path = require('path');\nconst os = require('os');\n\nconst expand = require('./../util/expand');\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst cp = {\n\n  exec(args, options) {\n    const self = this;\n    options = options || {};\n\n    args = (args === undefined) ? [] : args;\n    args = (Array.isArray(args)) ? args : args.split(' ');\n    args = args.filter(arg => String(arg).trim() !== '');\n\n    options.noclobber = (options.force === true) ? false : options.noclobber;\n    options.recursive = (options.R === true) ? true : options.recursive;\n\n    if (args.length < 1) {\n      this.log('cp: missing file operand\\nTry \\'cp --help\\' for more information.');\n      return 1;\n    }\n\n    if (args.length === 1) {\n      this.log(`cp: missing destination file operand after ${args[0]}\\nTry 'cp --help' for more information.`);\n      return 1;\n    }\n\n    args = expand(args);\n\n    const dest = args.pop();\n    let sources = args;\n\n    const exists = fs.existsSync(dest);\n    const stats = exists && fs.statSync(dest);\n\n    // Dest is not existing dir, but multiple sources given\n    if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n      this.log(`cp: target ${dest} is not a directory`);\n      return 1;\n    }\n\n    // Dest is an existing file, but no -f given\n    if (exists && stats.isFile() && options.noclobber) {\n      // just dont do anything\n      return 0;\n    }\n\n    if (options.recursive) {\n      sources.forEach(function (src, i) {\n        if (src[src.length - 1] === '/') {\n          sources[i] += '*';\n        } else if (fs.statSync(src).isDirectory() && !exists) {\n          sources[i] += '/*';\n        }\n      });\n      try {\n        fs.mkdirSync(dest, parseInt('0777', 8));\n      } catch (e) {\n        // like Unix's cp, keep going even if we can't create dest dir\n      }\n    }\n\n    sources = expand(sources);\n\n    sources.forEach(function (src) {\n      if (!fs.existsSync(src)) {\n        self.log(`cp: cannot stat ${src}: No such file or directory`);\n        return;\n      }\n\n      if (fs.statSync(src).isDirectory()) {\n        if (!options.recursive) {\n          self.log(`cp: omitting directory ${src}`);\n        } else {\n          // 'cp /a/source dest' should create 'source' in 'dest'\n          const newDest = path.join(dest, path.basename(src));\n          const checkDir = fs.statSync(src);\n          try {\n            fs.mkdirSync(newDest, checkDir.mode);\n          } catch (e) {\n            /* istanbul ignore if */\n            if (e.code !== 'EEXIST') {\n              throw new Error();\n            }\n          }\n          cpdirSyncRecursive.call(self, src, newDest, options);\n        }\n        return;\n      }\n\n      // If here, src is a file\n      // When copying to '/path/dir', iDest = '/path/dir/file1'\n      let iDest = dest;\n      if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) {\n        iDest = path.normalize(`${dest}/${path.basename(src)}`);\n      }\n\n      if (fs.existsSync(iDest) && options.no_force) {\n        return;\n      }\n\n      copyFileSync.call(self, src, iDest);\n    });\n  }\n};\n\nfunction cpdirSyncRecursive(sourceDir, destDir, options) {\n  const self = this;\n  /* istanbul ignore if */\n  if (!options) {\n    options = {};\n  }\n  const checkDir = fs.statSync(sourceDir);\n  try {\n    fs.mkdirSync(destDir, checkDir.mode);\n  } catch (e) {\n    /* istanbul ignore if */\n    if (e.code !== 'EEXIST') {\n      throw e;\n    }\n  }\n  const files = fs.readdirSync(sourceDir);\n  for (let i = 0; i < files.length; i++) {\n    const srcFile = `${sourceDir}/${files[i]}`;\n    const destFile = `${destDir}/${files[i]}`;\n    const srcFileStat = fs.lstatSync(srcFile);\n    if (srcFileStat.isDirectory()) {\n      // recursion this thing right on back.\n      cpdirSyncRecursive.call(self, srcFile, destFile, options);\n    } else if (srcFileStat.isSymbolicLink()) {\n      const symlinkFull = fs.readlinkSync(srcFile);\n      fs.symlinkSync(symlinkFull, destFile, os.platform() === 'win32' ? 'junction' : null);\n      // At this point, we've hit a file actually worth copying... so copy it on over.\n    } else if (fs.existsSync(destFile) && options.noclobber) {\n      // be silent\n    } else {\n      copyFileSync.call(self, srcFile, destFile);\n    }\n  }\n}\n\nfunction copyFileSync(src, dest) {\n  /* istanbul ignore if */\n  if (!fs.existsSync(src)) {\n    this.log(`cp: cannot stat ${src}: No such file or directory`);\n    return;\n  }\n\n  const BUF_LENGTH = 64 * 1024;\n  const buf = new Buffer(BUF_LENGTH);\n  let bytesRead = BUF_LENGTH;\n  let pos = 0;\n  let fdr = null;\n  let fdw = null;\n\n  try {\n    fdr = fs.openSync(src, 'r');\n  } catch (e) {\n    /* istanbul ignore next */\n    this.log(`cp: cannot open ${src}: ${e.code}`);\n    /* istanbul ignore next */\n    return;\n  }\n\n  try {\n    fdw = fs.openSync(dest, 'w');\n  } catch (e) {\n    /* istanbul ignore next */\n    this.log(`cp: cannot write to destination file ${dest}: ${e.code}`);\n    /* istanbul ignore next */\n    return;\n  }\n\n  while (bytesRead === BUF_LENGTH) {\n    bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos);\n    fs.writeSync(fdw, buf, 0, bytesRead);\n    pos += bytesRead;\n  }\n\n  fs.closeSync(fdr);\n  fs.closeSync(fdw);\n  fs.chmodSync(dest, fs.statSync(src).mode);\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return cp;\n  }\n  vorpal.api.cp = cp;\n  vorpal\n    .command('cp [args...]')\n    .parse(preparser)\n    .option('-f, --force', 'do not prompt before overwriting')\n    .option('-n, --no-clobber', 'do not overwrite an existing file')\n    .option('-r, --recursive', 'copy directories recursively')\n    .option('-R', 'copy directories recursively')\n    .autocomplete(fsAutocomplete())\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: cp,\n        args: args.args,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/echo.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst echo = {\n\n  exec(arg, options) {\n    const self = this;\n    options = options || {};\n\n    try {\n      let text = arg || '';\n      text = !Array.isArray(text) ? [text] : text;\n      let result = text.join(' ');\n      let out = '';\n      if (options.e && !options.E) {\n        for (let i = 0; i < result.length; ++i) {\n          const nxt = result[i] + (result[i + 1] || '');\n          if (nxt === '\\\\b') {\n            out = out.slice(0, out.length - 1);\n            i++;\n          } else if (nxt === '\\\\c') {\n            break;\n          } else if (nxt === '\\\\n') {\n            out += '\\n';\n            i++;\n          } else if (nxt === '\\\\r') {\n            out += '\\r';\n            i++;\n          } else if (nxt === '\\\\t') {\n            out += '     ';\n            i++;\n          } else if (nxt === '\\\\\\\\') {\n            out += '\\\\';\n            i += 2;\n          } else {\n            out += result[i];\n          }\n        }\n        result = out;\n      }\n\n      // Bug: If nothing is passed, ensure we keep\n      // a blank line. Vorpal is designed to just\n      // eat blank lines, so we have a problem.\n      result = result === ('') ? '' : result;\n\n      this.log(result);\n      return 0;\n    } catch (e) {\n      /* istanbul ignore next */\n      return echo.error.call(self, e);\n    }\n  },\n\n  error(e) {\n    /* istanbul ignore next */\n    this.log(e.stack);\n    /* istanbul ignore next */\n    return 2;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return echo;\n  }\n  vorpal.api.echo = echo;\n  vorpal\n    .command('echo [arg...]')\n    .parse(preparser)\n    .option('-e', 'enable interpretation of the following backslash escapes')\n    .option('-E', 'explicitly suppress interpretation of backslash escapes')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: echo,\n        args: args.arg,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/export.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst _export = {\n\n  exec(args, options) {\n    args = args || [];\n    options = options || {};\n\n    if (args.length < 1) {\n      options.p = true;\n    }\n\n    if (typeof args === 'string' || args instanceof String) {\n      args = [args];\n    }\n\n    // Parse similarly to how `alias` does\n    let id = args.join(' ');\n    let value = '';\n    if (String(id).indexOf('=') > -1) {\n      const parts = String(id).trim().split('=');\n      id = parts[0];\n      value = parts[1] || value;\n      if (value.match(/^\".*\"$/)) {\n        value = JSON.parse(value);\n      } else {\n        const regMatch = value.match(/^'(.*)'$/);\n        if (regMatch && regMatch[1]) {\n          value = regMatch[1];\n        }\n      }\n    } else {\n      const parts = String(id).trim().split(' ');\n      id = parts.shift();\n      value = parts.join(' ') || null;\n    }\n\n    const validIdRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n    if (options.p) {\n      for (const name in process.env) {\n        if (process.env.hasOwnProperty(name)) {\n          this.log(`declare -x ${String(name)}=${JSON.stringify(process.env[name])\n            .replace(/\\$/g, '\\\\$')}`);\n        }\n      }\n    } else if (id.match(validIdRegex)) {\n      process.env[id] = value !== null ? value : process.env[id];\n    } else {\n      this.log(`-cash: export: \\`${id}': not a valid identifier`);\n      return 1;\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _export;\n  }\n  vorpal.api.export = _export;\n  vorpal\n    .command('export [name...]')\n    .parse(preparser)\n    .option('-p', 'print all defined aliases in a reusable format')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: _export,\n        args: args.name,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/false.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\n\nconst _false = {\n  exec() {\n    // Always return 1\n    return 1;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _false;\n  }\n  vorpal.api.false = _false;\n  vorpal\n    .command('false')\n    .action(function (args, callback) {\n      return interfacer.call(this, {\n        command: _false,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/grep.js",
    "content": "'use strict';\n\nmodule.exports = require('vorpal-grep');\n"
  },
  {
    "path": "src/commands/head.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst expand = require('./../util/expand');\n\nconst head = {\n\n  exec(args, options) {\n    options = options || {};\n    args = args || '';\n    const source = (args.stdin === undefined) ? 'files' : 'stdin';\n\n    const lines = (options.lines) ? Math.abs(options.lines) : 10;\n    if (!Number.isInteger(lines)) {\n      this.log(`head: ${options.lines}: invalid number of lines`);\n      return 0;\n    }\n\n    /* istanbul ignore next */\n    if (source === 'stdin') {\n      let stdout = head.readLines(args.stdin[0], lines);\n      stdout = stdout.replace(/\\n$/, '');\n      if (stdout.trim() !== '') {\n        this.log(stdout);\n      }\n      return 0;\n    }\n\n    let files = args.files || args;\n    files = (typeof files === 'object' && files !== null && !Array.isArray(files)) ? [] : files;\n    files = (files === undefined) ? [] : files;\n    files = (typeof files === 'string') ? String(files).split(' ') : files;\n    files = files.filter(arg => String(arg).trim() !== '');\n    files = expand(files);\n\n    let stdout = '';\n    const verbose = ((files.length > 1 && !options.silent) || options.verbose);\n\n    for (let i = 0; i < files.length; i++) {\n      try {\n        const content = fs.readFileSync(files[i]).toString();\n        if (verbose) {\n          stdout += `${i > 0 ? '\\n' : ''}==> ${files[i]} <==\\n`;\n        }\n        stdout += head.readLines(content, lines);\n      } catch (e) {\n        stdout += `head: cannot open ${files[i]} for reading: No such file or directory`;\n      }\n    }\n\n    stdout = stdout.replace(/\\n$/, '');\n    if (stdout.trim() !== '') {\n      this.log(stdout);\n    }\n\n    return 0;\n  },\n\n  readLines(content, numberOfLines) {\n    let stdout = '';\n    const contentArray = content.split('\\n');\n    const linesToRead = numberOfLines >= contentArray.length ? contentArray.length : numberOfLines;\n    for (let i = 0; i < linesToRead; i++) {\n      if (stdout === '') {\n        stdout = `${contentArray[i]}\\n`;\n        continue;\n      }\n      stdout += `${contentArray[i]}\\n`;\n    }\n    return stdout;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return head;\n  }\n  vorpal.api.head = head;\n  vorpal\n      .command('head [files...]')\n      .option('-n, --lines [number]', 'print the first K lines instead of the first 10')\n      .option('-q, --silent', 'Suppresses printing of headers when multiple files are being examined.')\n      .option('-v, --verbose', 'Always output headers giving file names.')\n      .autocomplete(fsAutocomplete())\n      .action(function (args, callback) {\n        args.options = args.options || {};\n        return interfacer.call(this, {\n          command: head,\n          args,\n          options: args.options,\n          callback\n        });\n      });\n};\n"
  },
  {
    "path": "src/commands/kill.js",
    "content": "'use strict';\n\nconst fkill = require('fkill');\nconst os = require('os');\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst usage = `kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]`;\nconst windows = (os.platform().indexOf('win') > -1);\nconst signals = {\n  SIGKILL: 9,\n  SIGTERM: 15,\n  KILL: 9,\n  TERM: 15,\n  9: 'KILL',\n  15: 'TERM'\n};\n\nconst kill = {\n\n  exec(args, options) {\n    options = options || {};\n\n    let procs = args;\n    procs = (procs === undefined) ? [] : procs;\n    procs = (typeof procs === 'string') ? String(procs).split(' ') : procs;\n    procs = procs.filter(arg => String(arg).trim() !== '');\n\n    function log(str) {\n      if (options.vorpal) {\n        options.vorpal.log(str);\n      } else {\n        /* istanbul ignore next */\n        console.log(str);\n      }\n    }\n\n    if (options.l !== undefined) {\n      if (options.l === true) {\n        this.log(` 9) SIGKILL   15) SIGTERM`);\n        return 0;\n      }\n      if (signals[options.l]) {\n        this.log(signals[options.l]);\n        return 0;\n      }\n      this.log(`-cash: kill: ${options.l}: invalid signal specification`);\n      return 0;\n    }\n\n    if (procs.length < 1) {\n      this.log(usage);\n      return 0;\n    }\n\n    const forced = (options['9'] === true) ||\n      (options.n === 9) ||\n      (String(options.s).toLowerCase() === 'sigkill') ||\n      (String(options.s).toLowerCase() === 'kill');\n    const opts = {force: forced};\n\n    for (let i = 0; i < procs.length; ++i) {\n      let proc = procs[i];\n      proc = (!isNaN(proc)) ? parseFloat(proc) : proc;\n      proc = (windows && isNaN(proc) && proc.indexOf('.') === -1) ?\n        `${proc}.exe` :\n        proc;\n      fkill(proc, opts).then(function () {\n        // .. chill\n      }).catch(function (err) {\n        if (String(err.message).indexOf('failed') > -1) {\n          log(`-cash: kill: (${proc}) - No such process`);\n        }\n      });\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return kill;\n  }\n  vorpal.api.kill = kill;\n  vorpal\n    .command('kill [process...]')\n    .parse(preparser)\n    .option('-9', 'sigkill')\n    .option('-s [sig]', 'sig is a signal name')\n    .option('-n [sig]', 'sig is a signal number')\n    .option('-l [sigspec]', 'list the signal names')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      args.options.vorpal = vorpal;\n      return interfacer.call(this, {\n        command: kill,\n        args: args.process,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/less.js",
    "content": "'use strict';\n\nmodule.exports = require('vorpal-less');\n"
  },
  {
    "path": "src/commands/ls.js",
    "content": "'use strict';\n\nconst chalk = require('chalk');\nconst filesize = require('filesize');\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\nconst os = require('os');\n\nconst expand = require('./../util/expand');\nconst colorFile = require('./../util/colorFile');\nconst columnify = require('./../util/columnify');\nconst dateConverter = require('./../util/converter.date');\nconst fileFromPath = require('./../util/fileFromPath');\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\nconst pad = require('./../util/pad');\nconst lpad = require('./../util/lpad');\nconst permissionsConverter = require('./../util/converter.permissions');\nconst strip = require('./../util/stripAnsi');\nconst walkDir = require('./../util/walkDir');\nconst walkDirRecursive = require('./../util/walkDirRecursive');\n\nconst pads = {pad, lpad};\n\nconst ls = {\n\n  self: null,\n\n  /**\n   * Main command execution.\n   *\n   * @return {Object} { status, stdout }\n   * @api public\n   * @param paths\n   * @param options\n   */\n  exec(paths, options) {\n    ls.self = this;\n    paths = (paths !== null && !Array.isArray(paths) && (typeof paths === 'object')) ? paths.paths : paths;\n    paths = paths || ['.'];\n    paths = (Array.isArray(paths)) ? paths : [paths];\n    paths = expand(paths);\n\n    options = options || {};\n\n    const preSortedPaths = ls.preSortPaths(paths);\n\n    let dirResults = [];\n    for (let i = 0; i < preSortedPaths.dirs.length; ++i) {\n      if (options.recursive) {\n        const result = ls.execDirRecursive(preSortedPaths.dirs[i], options);\n        dirResults = dirResults.concat(result);\n      } else {\n        dirResults.push(ls.execDir(preSortedPaths.dirs[i], options));\n      }\n    }\n\n    let stdout = '';\n    if (preSortedPaths.files.length > 0) {\n      stdout += ls.execLsOnFiles('.', preSortedPaths.files, options).results;\n    }\n\n    const dirOutput = ls.formatAll(dirResults, options, (dirResults.length + preSortedPaths.files.length > 1));\n    stdout += (stdout && dirOutput) ? `\\n\\n${dirOutput}` : dirOutput;\n    if (strip(stdout).trim() !== '') {\n      ls.self.log(String(stdout).replace(/\\\\/g, '/'));\n    }\n\n    return 0;\n  },\n\n  preSortPaths(paths) {\n    const dirs = [];\n    const files = [];\n\n    for (let i = 0; i < paths.length; i++) {\n      const p = paths[i];\n      try {\n        const stat = fs.statSync(p);\n        if (stat.isDirectory()) {\n          dirs.push(p);\n        } else if (stat.isFile()) {\n          files.push({\n            file: p,\n            data: stat\n          });\n        }\n      } catch (e) {\n        e.syscall = 'scandir';\n        ls.error(p, e);\n      }\n    }\n    files.sort();\n    dirs.sort();\n\n    return {files, dirs};\n  },\n\n  /**\n   * Returns ls stderr and response codes\n   * for errors.\n   *\n   * @param {String} path\n   * @param {Error} e\n   * @param {String} e.code\n   * @param {String} e.syscall\n   * @param {String} e.stack\n   * @api private\n   */\n  error(path, e) {\n    let status;\n    let stdout;\n\n    if (e.code === 'ENOENT' && e.syscall === 'scandir') {\n      status = 1;\n      stdout = `ls: cannot access ${path}: No such file or directory`;\n    } else {\n      status = 2;\n      stdout = e.stack;\n    }\n\n    ls.self.log(stdout);\n    return {status, stdout};\n  },\n\n  /**\n   * Recursively executes `execDir`.\n   * For use with `ls -R`.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @return {Array} results\n   * @api private\n   */\n\n  execDirRecursive(path, options) {\n    const self = this;\n    const results = [];\n    walkDirRecursive(path, pth => {\n      const result = self.execDir(pth, options);\n      results.push(result);\n    });\n\n    return results;\n  },\n\n  /**\n   * Executes `ls` functionality\n   * for a given directory.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @return {{path: String, size: *, results: *}} results\n   * @api private\n   */\n  execDir(path, options) {\n    const rawFiles = [];\n\n    function pushFile(file, data) {\n      rawFiles.push({\n        file,\n        data\n      });\n    }\n\n    // Add in implied current and parent dirs.\n    pushFile('.', fs.statSync('.'));\n    pushFile('..', fs.statSync('..'));\n\n    // Walk the passed in directory,\n    // pushing the results into `rawFiles`.\n    walkDir(path, pushFile, ls.error);\n\n    const o = ls.execLsOnFiles(path, rawFiles, options);\n    o.path = path;\n    return o;\n  },\n\n  execLsOnFiles(path, rawFiles, options) {\n    const files = [];\n    let totalSize = 0;\n\n    // Sort alphabetically be default,\n    // unless -U is specified, in which case\n    // we don't sort.\n    if (!options.U) {\n      rawFiles = rawFiles.sort(function (a, b) {\n        // Sort by size.\n        if (options.S) {\n          // Hack for windows - a directory lising\n          // in linux says the size is 4096, and Windows\n          // it's 0, leading to inconsistent sorts based\n          // on size, and failing tests.\n          const win = (os.platform() === 'win32');\n          a.data.size = (win && a.data.isDirectory() && a.data.size === 0) ? 4096 : a.data.size;\n          b.data.size = (win && b.data.isDirectory() && b.data.size === 0) ? 4096 : b.data.size;\n          return (a.data.size > b.data.size) ? -1 : (a.data.size < b.data.size) ? 1 : 0;\n        }\n        if (options.t) {\n          // Sort by date modified.\n          return ((a.data.mtime < b.data.mtime) ? 1 :\n              (b.data.mtime < a.data.mtime) ? -1 :\n                  0);\n        }\n        // Sort alphabetically - default.\n        const aFileName = fileFromPath(a.file)\n            .trim()\n            .toLowerCase()\n            .replace(/\\W/g, '');\n        const bFileName = fileFromPath(b.file)\n            .trim()\n            .toLowerCase()\n            .replace(/\\W/g, '');\n        return (aFileName > bFileName) ? 1 : (aFileName < bFileName) ? -1 : 0;\n      });\n    }\n\n    // Reverse whatever sort the user specified.\n    if (options.reverse) {\n      rawFiles.reverse();\n    }\n\n    for (let i = 0; i < rawFiles.length; ++i) {\n      const file = rawFiles[i].file;\n      const data = rawFiles[i].data;\n      const fileShort = fileFromPath(file);\n      const dotted = (fileShort && fileShort.charAt(0) === '.');\n      const implied = (fileShort === '..' || fileShort === '.');\n      const type = (data.isDirectory()) ? 'd' : '-';\n      const permissions = permissionsConverter.modeToRWX(data.mode);\n      const hardLinks = data.nlink;\n      const size = (options.humanreadable) ? filesize(data.size, {unix: true}) : data.size;\n      const modified = dateConverter.unix(data.mtime);\n      const owner = data.uid;\n      const group = data.gid;\n      const inode = data.ino;\n\n      totalSize += data.size;\n\n      let fileName = fileShort;\n\n      // If --classify, add '/' to end of folders.\n      fileName = (options.classify && data.isDirectory()) ? `${fileName}/` : fileName;\n\n      // If getting --directory, give full path.\n      fileName = (options.directory && file === '.') ? path : fileName;\n\n      // Color the files based on $LS_COLORS\n      fileName = (data.isFile()) ? colorFile(fileName) : fileName;\n\n      // If not already colored and is executable,\n      // make it green\n      const colored = (strip(fileName) !== fileName);\n      if (String(permissions).indexOf('x') > -1 && !colored && data.isFile()) {\n        fileName = chalk.green(fileName);\n      }\n\n      // If --quote-name, wrap in double quotes;\n      fileName = (options.quotename) ? `\"${fileName}\"` : fileName;\n\n      // Make directories cyan.\n      fileName = (data.isDirectory()) ? chalk.cyan(fileName) : fileName;\n\n      const include = (() => {\n        const directory = options.directory;\n        const all = options.all;\n        const almostAll = options.almostall;\n        let result = false;\n        if (directory && file !== '.') {\n          result = false;\n        } else if (!dotted) {\n          result = true;\n        } else if (all) {\n          result = true;\n        } else if (!implied && almostAll) {\n          result = true;\n        } else if (directory && file === '.') {\n          result = true;\n        }\n        return result;\n      })();\n\n      const details = [type + permissions, hardLinks, owner, group, size, modified, fileName];\n\n      if (options.inode) {\n        details.unshift(inode);\n      }\n\n      const result = (options.l && !options.x) ? details : fileName;\n\n      if (include) {\n        files.push(result);\n      }\n    }\n\n    return ls.formatDetails(files, totalSize, options);\n  },\n\n  formatDetails(files, totalSize, options) {\n    let result;\n\n    // If we have the detail view, draw out\n    // all of the details of each file.\n    // Otherwise, just throw the file names\n    // into columns.\n    if (Array.isArray(files[0])) {\n      const longest = {};\n      for (let i = 0; i < files.length; ++i) {\n        for (let j = 0; j < files[i].length; ++j) {\n          const len = String(files[i][j]).length;\n          longest[j] = longest[j] || 0;\n          longest[j] = (len > longest[j]) ? len : longest[j];\n        }\n      }\n\n      const newFiles = [];\n      for (let i = 0; i < files.length; ++i) {\n        let glob = '';\n        for (let j = 0; j < files[i].length; ++j) {\n          const padFn = (j === files[i].length - 1) ? 'pad' : 'lpad';\n          if (j === files[i].length - 1) {\n            glob += String(files[i][j]);\n          } else {\n            glob += `${pads[padFn](String(files[i][j]), longest[j], ' ')} `;\n          }\n        }\n        newFiles.push(String(glob));\n      }\n      result = newFiles.join('\\n');\n    } else if (options['1']) {\n      result = files.join('\\n');\n    } else {\n      const opt = {};\n      if (options.width) {\n        opt.width = options.width;\n      }\n\n      result = columnify(files, opt);\n    }\n\n    return ({\n      size: (options.humanreadable) ? filesize(totalSize, {unix: true}) : totalSize,\n      results: result\n    });\n  },\n\n  /**\n   * Concatenates the results of multiple\n   * `execDir` functions into their proper\n   * form based on options provided.\n   *\n   * @param {Array} results\n   * @param {Object} options\n   * @param {boolean} showName\n   * @return {String} stdout\n   * @api private\n   */\n\n  formatAll(results, options, showName) {\n    let stdout = '';\n    if (showName) {\n      for (let i = 0; i < results.length; ++i) {\n        stdout += `${results[i].path}:\\n`;\n        if (options.l) {\n          stdout += `total ${results[i].size}\\n`;\n        }\n        stdout += results[i].results;\n        if (i !== results.length - 1) {\n          stdout += '\\n\\n';\n        }\n      }\n    } else if (results.length === 1) {\n      if (options.l && !options.x) {\n        stdout += `total ${results[0].size}\\n`;\n      }\n      stdout += results[0].results;\n    }\n    return stdout;\n  }\n};\n\n/**\n * Expose as a Vorpal extension.\n */\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return ls;\n  }\n  vorpal.api.ls = ls;\n  vorpal\n      .command('ls [paths...]')\n      .parse(preparser)\n      .option('-a, --all', 'do not ignore entries starting with .')\n      .option('-A, --almost-all', 'do not list implied . and ..')\n      .option('-d, --directory', 'list directory entries instead of contents, and do not dereference symbolic links')\n      .option('-F, --classify', 'append indicator (one of */=>@|) to entries')\n      .option('-h, --human-readable', 'with -l, print sizes in human readable format (e.g., 1K 234M 2G)')\n      .option('-i, --inode', 'print the index number of each file')\n      .option('-l', 'use a long listing format')\n      .option('-Q, --quote-name', 'enclose entry names in double quotes')\n      .option('-r, --reverse', 'reverse order while sorting')\n      .option('-R, --recursive', 'list subdirectories recursively')\n      .option('-S', 'sort by file size')\n      .option('-t', 'sort by modification time, newest first')\n      .option('-U', 'do not sort; list entries in directory order')\n      .option('-w, --width [COLS]', 'assume screen width instead of current value')\n      .option('-x', 'list entries by lines instead of columns')\n      .option('-1', 'list one file per line')\n      .autocomplete(fsAutocomplete())\n      .action(function (args, cb) {\n        return interfacer.call(this, {\n          command: ls,\n          args: args.paths,\n          options: args.options,\n          callback: cb\n        });\n      });\n};\n"
  },
  {
    "path": "src/commands/mkdir.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst mkdir = {\n\n  exec(args, options) {\n    const self = this;\n    let dirs = args || [];\n    options = options || {};\n\n    if (typeof dirs === 'string') {\n      dirs = dirs.split(' ');\n    }\n\n    dirs = dirs.filter(str => String(str).trim() !== '');\n\n    if (dirs.length < 1) {\n      this.log('mkdir: missing operand\\nTry \\'mkdir --help\\' for more information.');\n    }\n\n    dirs.forEach(function (dir) {\n      if (fs.existsSync(dir)) {\n        if (!options.parents) {\n          self.log(`mkdir: cannot create directory ${dir}: File exists`);\n        }\n        return;\n      }\n\n      // Base dir does not exist, and no -p option given\n      const baseDir = path.dirname(dir);\n      if (!fs.existsSync(baseDir) && !options.parents) {\n        self.log(`mkdir: cannot create directory ${dir}: No such file or directory`);\n        return;\n      }\n\n      if (options.parents) {\n        mkdirSyncRecursive.call(self, dir, options);\n      } else {\n        fs.mkdirSync(dir, parseInt('0777', 8));\n        if (options.verbose) {\n          self.log(`mkdir: created directory ${dir}`);\n        }\n      }\n    });\n    return 0;\n  }\n};\n\nfunction mkdirSyncRecursive(dir, options) {\n  const baseDir = path.dirname(dir);\n  if (fs.existsSync(baseDir)) {\n    fs.mkdirSync(dir, parseInt('0777', 8));\n    if (options.verbose) {\n      this.log(`mkdir: created directory ${dir}`);\n    }\n    return;\n  }\n  mkdirSyncRecursive.call(this, baseDir, options);\n  fs.mkdirSync(dir, parseInt('0777', 8));\n  if (options.verbose) {\n    this.log(`mkdir: created directory ${dir}`);\n  }\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return mkdir;\n  }\n  vorpal.api.mkdir = mkdir;\n  vorpal\n    .command('mkdir [directory...]')\n    .parse(preparser)\n    .option('-p, --parents', 'no error if existing, make parent directories as needed')\n    .option('-v, --verbose', 'print a message for each created directory')\n    .autocomplete(fsAutocomplete({directory: true}))\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      args.options.vorpal = vorpal;\n      return interfacer.call(this, {\n        command: mkdir,\n        args: args.directory,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/mv.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\nconst path = require('path');\n\nconst expand = require('./../util/expand');\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst mv = {\n\n  exec(args, options) {\n    const self = this;\n    options = options || {};\n\n    args = (args === undefined) ? [] : args;\n    args = (Array.isArray(args)) ? args : args.split(' ');\n    args = args.filter(arg => String(arg).trim() !== '');\n\n    options.noclobber = (options.force === true) ? false : options.noclobber;\n\n    if (args.length < 1) {\n      this.log('mv: missing file operand\\nTry \\'mv --help\\' for more information.');\n      return 1;\n    }\n\n    if (args.length === 1) {\n      this.log(`mv: missing destination file operand after ${args[0]}\\nTry 'mv --help' for more information.`);\n      return 1;\n    }\n\n    args = expand(args);\n\n    const dest = args.pop();\n    let sources = args;\n\n    const exists = fs.existsSync(dest);\n    const stats = exists && fs.statSync(dest);\n\n    // Dest is not existing dir, but multiple sources given\n    if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n      this.log(`mv: target ${dest} is not a directory`);\n      return 1;\n    }\n\n    // Dest is an existing file, but no -f given\n    if (exists && stats.isFile() && options.noclobber) {\n      // just dont do anything\n      return 0;\n    }\n\n    if (options.striptrailingslashes) {\n      sources = sources.map(src => String(src).replace(/\\/$/g, ''));\n    }\n\n    sources.forEach(function (src) {\n      if (!fs.existsSync(src)) {\n        self.log(`mv: cannot stat ${src}: No such file or directory`);\n        return;\n      }\n\n      // When copying to '/path/dir', iDest = '/path/dir/file1'\n      let iDest = dest;\n      if (exists && stats.isDirectory()) {\n        iDest = path.normalize(`${dest}/${path.basename(src)}`);\n      }\n\n      // If the file exists and we're not clobbering, skip.\n      if (fs.existsSync(iDest) && options.noclobber) {\n        return;\n      }\n\n      if (path.resolve(src) === path.dirname(path.resolve(iDest))) {\n        self.log(`mv: ${src} and ${iDest} are the same file`);\n        return;\n      }\n\n      fs.renameSync(src, iDest);\n      if (options.verbose === true) {\n        self.log(String(`${src} -> ${iDest}`).replace(/\\\\/g, '/'));\n      }\n    });\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return mv;\n  }\n  vorpal.api.mv = mv;\n  vorpal\n    .command('mv [args...]')\n    .parse(preparser)\n    .option('-f, --force', 'do not prompt before overwriting')\n    .option('-n, --no-clobber', 'do not overwrite an existing file')\n    .option('--striptrailingslashes', 'remove any trailing slashes from each source') // vorpal bug, need to add dashes between words\n    .option('-v, --verbose', 'explain what is being done')\n    .autocomplete(fsAutocomplete())\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: mv,\n        args: args.args,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/pwd.js",
    "content": "'use strict';\n\nconst path = require('path');\n\nconst interfacer = require('./../util/interfacer');\n\nconst pwd = {\n  exec() {\n    this.log(path.resolve(process.cwd()).replace(/\\\\/g, '/'));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return pwd;\n  }\n  vorpal.api.pwd = pwd;\n  vorpal\n    .command('pwd [files...]')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: pwd,\n        args: args.files,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/rm.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst expand = require('./../util/expand');\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\nconst unlinkSync = require('./../util/unlinkSync');\n\nconst rm = {\n\n  exec(args, options) {\n    const self = this;\n    options = options || {};\n    options.recursive = (options.R) ?\n      options.R :\n      options.recursive;\n\n    let files = args;\n    files = (files === undefined) ? [] : files;\n    files = (typeof files === 'string') ? [files] : files;\n\n    files = expand(files);\n\n    files.forEach(function (file) {\n      if (!fs.existsSync(file)) {\n        // Path does not exist, no force flag given\n        if (!options.force) {\n          self.log(`rm: cannot remove ${file}: No such file or directory`);\n          return 2;\n        }\n        /* istanbul ignore next */\n        return 0;\n      }\n\n      const stats = fs.lstatSync(file);\n      if (stats.isFile() || stats.isSymbolicLink()) {\n        if (options.force) {\n          unlinkSync(file);\n          return 0;\n        }\n\n        if (isWriteable(file)) {\n          unlinkSync(file);\n        } else {\n          /* istanbul ignore next */\n          self.log(`rm: cannot remove ${file}: permission denied`);\n          /* istanbul ignore next */\n          return 2;\n        }\n        return 0;\n      }\n\n      // Path is an existing directory, but no -r flag given\n      if (stats.isDirectory() && !options.recursive) {\n        self.log(`rm: cannot remove: path is a directory`);\n        return 2;\n      }\n\n      // Recursively remove existing directory\n      if (stats.isDirectory() && options.recursive) {\n        rmdirSyncRecursive.call(self, file, options.force, options.dir);\n      }\n    });\n  }\n};\n\nfunction rmdirSyncRecursive(dir, force, removeEmptyDir) {\n  const self = this;\n  let files;\n  files = fs.readdirSync(dir);\n\n  // Loop through and delete everything in the sub-tree after checking it\n  for (let i = 0; i < files.length; i++) {\n    const file = `${dir}/${files[i]}`;\n    const currFile = fs.lstatSync(file);\n\n    if (currFile.isDirectory()) { // Recursive function back to the beginning\n      rmdirSyncRecursive(file, force, removeEmptyDir);\n    } else if (currFile.isSymbolicLink()) {\n      // Unlink symlinks\n      /* istanbul ignore next */\n      if (force || isWriteable(file)) {\n        try {\n          unlinkSync(file);\n        } catch (e) {\n          self.log(`rm: cannot remove ${file}: code ${e.code}`);\n          return 2;\n        }\n      }\n    } else if (force || isWriteable(file)) {\n      // Assume it's a file.\n      try {\n        unlinkSync(file);\n      } catch (e) {\n        /* istanbul ignore next */\n        self.log(`rm: cannot remove ${file}: code ${e.code}`);\n        /* istanbul ignore next */\n        return 2;\n      }\n    }\n  }\n\n  // Now that we know everything in the sub-tree has been deleted,\n  // we can delete the main directory.\n  let result;\n  try {\n    // Retry on windows, sometimes it takes a little time before all the files in the directory are gone\n    const start = Date.now();\n    while (true) {\n      try {\n        result = fs.rmdirSync(dir);\n        /* istanbul ignore next */\n        if (fs.existsSync(dir)) {\n          throw new Error('EAGAIN');\n        }\n        break;\n      } catch (er) {\n        // In addition to error codes, also check if the directory still exists and loop again if true\n        /* istanbul ignore next */\n        if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) {\n          if (Date.now() - start > 1000) {\n            throw er;\n          }\n        /* istanbul ignore next */\n        } else if (er.code === 'ENOENT') {\n          // Directory did not exist, deletion was successful\n          break;\n        /* istanbul ignore next */\n        } else {\n          throw er;\n        }\n      }\n    }\n  } catch (e) {\n    /* istanbul ignore next */\n    self.log(`rm: cannot remove directory ${dir}: code ${e.code}`);\n    /* istanbul ignore next */\n    return 2;\n  }\n  return result;\n}\n\n// Hack to determine if file has write permissions for current user\n// Avoids having to check user, group, etc, but it's probably slow.\nfunction isWriteable(file) {\n  let writePermission = true;\n  try {\n    const __fd = fs.openSync(file, 'a');\n    fs.closeSync(__fd);\n  } catch (e) {\n    /* istanbul ignore next */\n    writePermission = false;\n  }\n\n  return writePermission;\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return rm;\n  }\n  vorpal.api.rm = rm;\n  vorpal\n    .command('rm [files...]')\n    .parse(preparser)\n    .option('-f, --force', 'ignore nonexistent files and arguments, never prompt')\n    .option('-r, --recursive', 'remove directories and their contents recursively')\n    .option('-R', 'remove directories and their contents recursively')\n    .autocomplete(fsAutocomplete())\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: rm,\n        args: args.files,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/sort.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst fetch = require('./../util/fetch');\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\nconst strip = require('./../util/stripAnsi');\nconst shuffle = require('array-shuffle');\n\nconst sort = {\n\n  counter: 0,\n\n  stdin: '',\n\n  exec(args, options) {\n    const self = this;\n\n    // Hack to handle multiple calls\n    // due to fragmented stdin, such as\n    // by piping. In essence, we're waiting\n    // 100 milliseconds for all of the\n    // requests to come in, and then running\n    // sort. Only applies when sort is called\n    // through a piped command.\n    /* istanbul ignore next */\n    if (args && args.stdin && options.bypass !== true) {\n      sort.counter++;\n      sort.stdin += `${args.stdin}\\n`;\n      if (sort.counter === 1) {\n        setTimeout(function () {\n          sort.counter = 0;\n          args.stdin = sort.stdin;\n          sort.stdin = '';\n          options.bypass = true;\n          sort.exec.call(self, args, options);\n        }, 100);\n      }\n      return;\n    }\n    sort.counter = 0;\n    sort.stdin = '';\n\n    // Input normalization\n    if (args === undefined) {\n      args = {\n        files: []\n      };\n    } else if (typeof args === 'string' || args instanceof String) {\n      args = {\n        files: [args]\n      };\n    } else if (Array.isArray(args)) {\n      args = {\n        files: args\n      };\n    }\n\n    options = options || {};\n\n    function log(stdout) {\n      if (options.output) {\n        if (options.output === true) {\n          self.log(`sort: option '--output' requires an argument\\nTry 'sort --help' for more information.`);\n          return 0;\n        }\n        try {\n          fs.writeFileSync(options.output, stdout);\n          return 0;\n        } catch (e) {\n          if (e.code === 'ENOENT') {\n            self.log(`sort: open failed: ${options.output}: No such file or directory`);\n          } else {\n            /* istanbul ignore next */\n            self.log(`sort: open failed: ${options.output}: ${e.code}`);\n          }\n          return 2;\n        }\n      } else {\n        self.log(stdout);\n      }\n    }\n\n    try {\n      const stdin = fetch(args.files, args.stdin, {\n        onDirectory(name) {\n          /* istanbul ignore next */\n          return `sort: read failed: ${name}: Is a directory`;\n        },\n        onInvalidFile(name) {\n          /* istanbul ignore next */\n          return `sort: cannot read: ${name}: No such file or directory`;\n        }\n      });\n\n      let combined = '';\n      for (let i = 0; i < stdin.length; ++i) {\n        // Get rid of trailing line break because\n        // node logging does it anyway.\n        combined += stdin[i];\n      }\n\n      combined = combined.replace(/\\s$/, '');\n      let parts = String(combined).split('\\n');\n\n      if (options.check) {\n        // Check if the thing was already sorted.\n        const original = String(combined).split('\\n');\n        let disorder;\n        for (let i = 0; i < original.length; ++i) {\n          const a = original[i];\n          const b = original[i + 1];\n          if (a && b) {\n            if (!isNaN(a) && !isNaN(b) && parseFloat(a) > parseFloat(b)) {\n              /* istanbul ignore next */\n              disorder = true;\n            } else if (a > b) {\n              disorder = true;\n            }\n            if (disorder) {\n              // To do: right now, I don't say the file\n              // name of the bad sorted item - I have to\n              // figure this out as I join all the files\n              // together beforehand and lose track.\n              disorder = `sort: -:${(i + 2)}: disorder: ${b}`;\n              break;\n            }\n          }\n        }\n        if (disorder) {\n          log(disorder);\n          return;\n        }\n      }\n\n      parts = parts.sort(function (a, b) {\n        const aAlpha = strip(a).replace(/\\W+/g, '');\n        const bAlpha = strip(b).replace(/\\W+/g, '');\n        const aNumeric = strip(a).replace(/\\D/g, '');\n        const bNumeric = strip(b).replace(/\\D/g, '');\n        if (options.humannumericsort) {\n          const aHuman = parseHumanReadableNumbers(strip(a));\n          const bHuman = parseHumanReadableNumbers(strip(b));\n          if (aHuman.group < bHuman.group) {\n            return -1;\n          } else if (aHuman.group > bHuman.group) {\n            return 1;\n          } else if (aHuman.num < bHuman.num) {\n            return -1;\n          } else if (aHuman.num > bHuman.num) {\n            return 1;\n          }\n          return aAlpha.localeCompare(bAlpha);\n        } else if (options.monthsort) {\n          const aMonth = parseMonths(strip(a));\n          const bMonth = parseMonths(strip(b));\n          let result = aMonth - bMonth;\n          if (aMonth === bMonth) {\n            result = aAlpha.localeCompare(bAlpha);\n          }\n          return result;\n        } else if (options.numericsort) {\n          let result = aNumeric - bNumeric;\n          result = (result === 0) ? aAlpha.localeCompare(bAlpha) : result;\n          return result;\n        }\n        return aAlpha.localeCompare(bAlpha);\n      });\n\n      if (options.randomsort) {\n        parts = shuffle(parts);\n      }\n\n      if (options.reverse) {\n        parts.reverse();\n      }\n\n      const out = parts.join('\\n');\n      if (String(out).trim() !== '') {\n        log(out);\n      }\n\n      return;\n    } catch (e) {\n      /* istanbul ignore next */\n      self.log(e.stack);\n      /* istanbul ignore next */\n      return;\n    }\n  }\n};\n\n// This shit is gnarly.\n// Per the coreutils sort.c:\n// <none/unknown> < K/k < M < G < T < P < E < Z < Y\nconst humanOrdering = {'': 0, 'K': 1, 'k': 1, 'M': 2, 'G': 3, 'T': 4, 'P': 5, 'E': 6, 'Z': 7};\nconst humanReadableSort = new RegExp(/^([0-9]+)?[\\.]?[0-9]+[K|k|M|G|T|P|E|Z|Y]/g);\nfunction parseHumanReadableNumbers(nbr) {\n  nbr = String(nbr).replace(/(\\r\\n|\\n|\\r)/gm, '');\n  if (String(nbr).match(humanReadableSort)) {\n    const num = parseFloat(String(nbr).replace(/[a-zA-Z]/g, '').trim());\n    const group = humanOrdering[String(nbr).replace(/[^a-zA-Z]/g, '').trim()] || 0;\n    return ({\n      num,\n      group\n    });\n  }\n  const isNumber = (String(nbr).match(/^[0-9]/));\n  const stripped = (isNumber) ? parseFloat(String(nbr).replace(/[^0-9.]/g, '')) : 'NaN';\n  const result = (!isNaN(stripped)) ? stripped : -99999999999;\n  return ({\n    num: result,\n    group: 0\n  });\n}\n\nconst monthOrdering = {\n  jan: 1,\n  feb: 2,\n  mar: 3,\n  apr: 4,\n  may: 5,\n  jun: 6,\n  jul: 7,\n  aug: 8,\n  sep: 9,\n  oct: 10,\n  nov: 11,\n  dec: 12\n};\n\nconst months = new RegExp(/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i);\nfunction parseMonths(str) {\n  const match = String(str).match(months);\n  if (match) {\n    return monthOrdering[String(str.slice(0, 3).toLowerCase())];\n  }\n  return 0;\n}\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return sort;\n  }\n  vorpal.api.sort = sort;\n  vorpal\n    .command('sort [files...]')\n    .parse(preparser)\n    .option('-M, --month-sort', 'compare (unknown) < \\'JAN\\' < ... < \\'DEC\\'')\n    .option('-h, --human-numeric-sort', 'compare human readable numbers (e.g., 2K 1G)')\n    .option('-n, --numeric-sort', 'compare according to string numerical value')\n    .option('-R, --random-sort', 'sort by random hash of keys')\n    .option('-r, --reverse', 'reverse the result of comparisons')\n    .option('-c, --check', 'check for sorted input; do not sort')\n    .option('-o, --output [file]', 'write result to file instead of standard output')\n    .autocomplete(fsAutocomplete())\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: sort,\n        args,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/source.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\nconst fs = require('fs');\n\nconst usage = `-cash: source: filename argument required\\nsource: usage: source filename [arguments]`;\n\nconst source = {\n\n  exec(args, options) {\n    options = options || {};\n    args = args || {};\n\n    if (typeof args === 'string') {\n      const params = args.split(/\\s+/);\n      args = {};\n      args.file = params[0];\n      if (params.length > 1) {\n        args.params = params.slice(1);\n      }\n    }\n\n    const vorpal = options.vorpal;\n\n    /* istanbul ignore next */\n    if (!vorpal) {\n      throw new Error('Source is not programatically supported.');\n    }\n\n    if (!args.file) {\n      this.log(usage);\n      return 2;\n    }\n    try {\n      // Once support for referencing parameters ($1, $2, etc.) gets added, this\n      // should swap these out with the value of args.params\n      fs.readFileSync(args.file, 'utf8').split('\\n').forEach(function (line) {\n        if (line) {\n          vorpal.execSync(line); // execute each line in the current environment\n        }\n      });\n    } catch (e) {\n      if (e.code === 'ENOENT') {\n        this.log(`-cash: ${args.file}: No such file or directory`);\n      } else if (e.code === 'EACCES') {\n        this.log(`-cash: ${args.file}: Permission denied`);\n      } else if (e.code === 'EISDIR') {\n        this.log(`-cash: source: ${args.file}: is a directory`);\n      } else {\n        /* istanbul ignore next */\n        this.log(`-cash: source: unable to read ${args.file}`);\n      }\n      return 1;\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return source;\n  }\n  vorpal.api.source = source;\n  vorpal\n    .command('source [file] [params...]')\n    .alias('.')\n    .parse(preparser)\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      args.options.vorpal = vorpal;\n      return interfacer.call(this, {\n        command: source,\n        args,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/tail.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst interfacer = require('./../util/interfacer');\nconst expand = require('./../util/expand');\nconst unixPath = require('./../util/converter.path').unix;\n\nconst tail = {\n\n  exec(args, options) {\n    options = options || {};\n    const lines = (options.lines) ? Math.abs(options.lines) : 10;\n    if (!Number.isInteger(lines)) {\n      this.log(`tail: ${options.lines}: invalid number of lines`);\n      return 0;\n    }\n\n    let files = args;\n    files = (files === undefined) ? [] : files;\n    files = (typeof files === 'string') ? String(files).split(' ') : files;\n    files = files.filter(file => String(file).trim() !== '');\n    files = expand(files);\n\n    let out = '';\n    for (let i = 0; i < files.length; i++) {\n      let fileFound = false;\n      let isFile = false;\n\n      try {\n        fs.accessSync(files[i], fs.F_OK);\n        fileFound = true;\n      } catch (e) {\n        out += `tail: cannot open ${unixPath(files[i])} for reading: No such file or directory\\n`;\n      }\n\n      if (fileFound) {\n        isFile = fs.statSync(files[i]).isFile();\n      }\n\n      if (isFile) {\n        const name = unixPath(files[i]);\n        const content = fs.readFileSync(files[i], 'utf8').trim().split('\\n');\n        const verbose = ((files.length > 1 && !options.silent) || options.verbose);\n        if (verbose) {\n          out += `==> ${name} <==\\n`;\n        }\n        const sliced = content.slice(content.length - lines, content.length);\n        out += `${sliced.join('\\n')}\\n`;\n      }\n    }\n\n    out = out.replace(/\\n$/, '');\n    if (out.trim() !== '') {\n      this.log(out);\n    }\n\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return tail;\n  }\n  vorpal.api.tail = tail;\n  vorpal\n    .command('tail [files...]')\n    .option('-n, --lines <number>', 'Output the last N lines, instead of the last 10')\n    .option('-q, --silent', 'Suppresses printing of headers when multiple files are being examined.')\n    .option('-v, --verbose', 'Always output headers giving file names.')\n    .autocomplete(fsAutocomplete())\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      return interfacer.call(this, {\n        command: tail,\n        args: args.files,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/touch.js",
    "content": "'use strict';\n\nconst fs = require('fs-extra');\nconst fsAutocomplete = require('vorpal-autocomplete-fs');\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\nrequire('./../lib/sugar');\n\nconst touch = {\n\n  /**\n   * Main command execution.\n   *\n   * @param {Object} args\n   * @return {Object} { status, stdout }\n   * @api public\n   */\n\n  exec(files, options) {\n    const self = this;\n    files = files || ['.'];\n    files = (!Array.isArray(files)) ? [files] : files;\n    options = options || {};\n\n    // If any version of --no-create is passed, change it to false.\n    options.create = (options.create === true) ? false : options.create;\n\n    // If --time is passed, ensure a valid param is called in\n    // and map it to -a or -m, as this is the equivalent of these.\n    // Throw an error if nothing valid passed.\n    if (options.time) {\n      const a = ['access', 'atime', 'use'];\n      const m = ['modify', 'mtime'];\n      const opt = (a.indexOf(options.time) > -1) ? 'a' :\n        (m.indexOf(options.time) > -1) ? 'm' :\n        undefined;\n      if (!opt) {\n        const error =\n          `touch: invalid argument \"${options.time}\" for \"--time\"\\n` +\n          'Valid arguments are:\\n' +\n          '  - \"atime\", \"access\", \"use\"\\n' +\n          '  - \"mtime\", \"modify\"\\n' +\n          'Try \\'touch --help\\' for more information.';\n        // I think this is the stupidest thing\n        // I've ever written.\n        try {\n          throw new Error(error);\n        } catch (e) {\n          return touch.error.call(self, e);\n        }\n      } else {\n        options[opt] = true;\n      }\n    }\n\n    try {\n      let err = false;\n      for (let i = 0; i < files.length; ++i) {\n        try {\n          touch.file(files[i], options);\n        } catch (e) {\n          err = e;\n          break;\n        }\n      }\n      if (err) {\n        return touch.error.call(self, err);\n      }\n      return 0;\n    } catch (e) {\n      return touch.error.call(self, e);\n    }\n  },\n\n  /**\n   * Returns touch stderr and response codes\n   * for errors.\n   *\n   * @param {Error} e\n   * @return {Object} { status, stdout }\n   * @api private\n   */\n\n  error(e) {\n    this.log(e.message);\n    return 2;\n  },\n\n  /**\n   * Handler for a single file using touch.\n   *\n   * @param {String} path\n   * @param {Object} options\n   * @api private\n   */\n\n  file(path, options) {\n    try {\n      try {\n        fs.lstatSync(path);\n      } catch (e) {\n        // If the file doesn't exist and\n        // the user doesn't want to create it,\n        // we have no purpose in life. Goodbye.\n        if (options.create === false) {\n          throw new Error(e);\n        } else {\n          fs.closeSync(fs.openSync(path, 'wx'));\n        }\n      }\n\n      const stat = fs.statSync(path);\n      const dateToSet = (options.date) ?\n        Date.create(options.date) :\n        new Date();\n\n      if (String(dateToSet) === 'Invalid Date') {\n        throw new Error(`touch: invalid date format ${options.date}`);\n      }\n\n      // If -m, keep access time current.\n      let atime = (options.m === true) ? new Date(stat.atime) : dateToSet;\n\n      // If -a, keep mod time to current.\n      let mtime = (options.a === true) ? new Date(stat.mtime) : dateToSet;\n\n      if (options.reference !== undefined) {\n        let reference;\n        try {\n          reference = fs.statSync(options.reference);\n        } catch (e) {\n          throw new Error(`touch: failed to get attributes of ${options.reference}: No such file or directory`);\n        }\n        atime = (options.m === true) ? atime : reference.atime;\n        mtime = (options.a === true) ? mtime : reference.mtime;\n      }\n\n      fs.utimesSync(path, atime, mtime);\n      fs.utimesSync(path, atime, mtime);\n    } catch (e) {\n      throw new Error(e);\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return touch;\n  }\n  vorpal.api.touch = touch;\n  vorpal\n    .command('touch <files...>')\n    .parse(preparser)\n    .option('-a', 'change only the access time')\n    .option('-c, --no-create', 'do not create any files')\n    .option('-d, --date [STRING]', 'parse STRING and use it instead of current time')\n    .option('-m', 'change only the modification time')\n    .option('-r, --reference [FILE]', 'use this file\\'s times instead of current time')\n    .option('--time [WORD]', 'change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m')\n    .autocomplete(fsAutocomplete())\n    .action(function (args, callback) {\n      return interfacer.call(this, {\n        command: touch,\n        args: args.files || [],\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/true.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\n\nconst _true = {\n  exec() {\n    // Always return 0\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return _true;\n  }\n  vorpal.api.true = _true;\n  vorpal\n    .command('true')\n    .action(function (args, callback) {\n      return interfacer.call(this, {\n        command: _true,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/unalias.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst unalias = {\n\n  exec(args, options) {\n    args = args;\n    options = options || {};\n    const vorpal = options.vorpal;\n\n    if (!vorpal) {\n      /* istanbul ignore next */\n      throw new Error('Unalias is not programatically supported.');\n    }\n\n    vorpal._aliases = vorpal._aliases || [];\n\n    if (typeof args === 'string' || args instanceof String) {\n      args = String(args).split(' ');\n      args = args.filter(str => {\n        return String(str).trim() !== '';\n      });\n    }\n\n    // Validate no input with help.\n    if ((args === undefined || args.length < 1 || args === '') && !options.a) {\n      this.log('unalias: usage: unalias [-a] name [name ...]');\n      return 1;\n    }\n\n    // Pull list of aliases\n    let all;\n    try {\n      all = JSON.parse(vorpal.localStorage.getItem('aliases') || []);\n    } catch (e) {\n      /* istanbul ignore next */\n      all = [];\n      /* istanbul ignore next */\n      vorpal.localStorage.removeItem('aliases');\n    }\n\n    if (options.a) {\n      args = all;\n    }\n\n    // Remove each alias in the list.\n    for (let i = 0; i < args.length; ++i) {\n      const key = args[i];\n      const item = vorpal.localStorage.getItem(`alias|${key}`);\n      if (item !== undefined && item !== null) {\n        vorpal.localStorage.removeItem(`alias|${key}`);\n      } else {\n        this.log(`-cash: unalias: ${key}: not found`);\n      }\n      all = all.filter(str => {\n        return !(str === key);\n      });\n    }\n\n    // Rebuild alias lists.\n    const aliases = {};\n    /* istanbul ignore next */\n    for (let i = 0; i < all.length; ++i) {\n      const item = vorpal.localStorage.getItem(`alias|${all[i]}`);\n      if (item !== undefined && item !== null) {\n        aliases[all[i]] = item;\n      }\n    }\n    vorpal._aliases = aliases;\n\n    vorpal.localStorage.setItem('aliases', JSON.stringify(all));\n    return 0;\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return unalias;\n  }\n  vorpal.api.unalias = unalias;\n  vorpal\n    .command('unalias [name...]')\n    .parse(preparser)\n    .option('-a', 'remove all alias definitions')\n    .action(function (args, callback) {\n      args.options = args.options || {};\n      args.options.vorpal = vorpal;\n      return interfacer.call(this, {\n        command: unalias,\n        args: args.name,\n        options: args.options,\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/commands/which.js",
    "content": "'use strict';\n\nconst interfacer = require('./../util/interfacer');\nconst preparser = require('./../preparser');\n\nconst which = {\n  exec(args, options) {\n    options = options || {};\n\n    const command = ((args instanceof Array) ? args : [args]).join(' ');\n    if (command.length <= 0) {\n      return 0;\n    }\n    try {\n      this.log(require('which').sync(command));\n      return 0;\n    } catch (error) {\n      this.log(error);\n      return 1;\n    }\n  }\n};\n\nmodule.exports = function (vorpal) {\n  if (vorpal === undefined) {\n    return which;\n  }\n  vorpal.api.which = which;\n\n  vorpal\n    .command('which [command]')\n    .parse(preparser)\n    .action(function (args, callback) {\n      return interfacer.call(this, {\n        command: which,\n        args: args.command,\n        options: {},\n        callback\n      });\n    });\n};\n"
  },
  {
    "path": "src/delimiter.js",
    "content": "'use strict';\n\nconst os = require('os');\nconst username = require('username');\nconst userHome = require('user-home');\n\nconst isWindows = process.platform === 'win32';\nconst pathConverter = require('./util/converter.path');\n\nmodule.exports = {\n\n  refresh(vorpal, cb) {\n    cb = cb || function () {};\n    username().then(username => {\n      const user = username;\n      const host = String(os.hostname()).split('.')[0];\n      const home = pathConverter.unix(userHome);\n      let cwd = pathConverter.unix(process.cwd());\n      cwd = cwd.replace(home, '~');\n      let delimiter = `${user}@${host}:${cwd}$`;\n      // If we're on linux-based systems, color\n      // the prompt so we don't get confused.\n      if (!isWindows) {\n        delimiter = `\\u001b[32m${delimiter}\\u001b[39m`;\n      }\n      vorpal.delimiter(delimiter);\n      cb(null);\n    }).catch(err => cb(err));\n  },\n\n  getHomeDir() {\n    return userHome;\n  }\n};\n"
  },
  {
    "path": "src/help/alias.js",
    "content": "module.exports = `\nUsage: alias [OPTION] [name[=value] ...]\nDefine or display aliases.\n\nWithout arguments, \\`alias' prints the list of aliases in the reusable\nform \\`alias NAME=VALUE' on standard output.\n\nOtherwise, an alias is defined for each NAME whose VALUE is given.\nA trailing space in VALUE causes the next word to be checked for\nalias substitution when the alias is expanded.\n\n  -p           print all defined aliases in a reusable format\n      --help   display this help and exit\n\nReport alias bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/cat.js",
    "content": "module.exports = `\nUsage: cat [OPTION]... [FILE]...\nConcatenate FILE(s), or standard input, to standard output.\n\n  -A, --show-all           equivalent to -vET\n  -b, --number-nonblank    number nonempty output lines, overrides -n\n  -e                       equivalent to -vE\n  -E, --show-ends          display $ at end of each line\n  -n, --number             number all output lines\n  -s, --squeeze-blank      suppress repeated empty output lines\n  -t                       equivalent to -vT\n  -T, --show-tabs          display TAB characters as ^I\n  -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB\n      --help               display this help and exit\n\nWith no FILE, or when FILE is -, read standard input.\n\nExamples:\n  cat f - g  Output f's contents, then standard input, then g's contents.\n  cat        Copy standard input to standard output.\n\nReport cat bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/cd.js",
    "content": "module.exports = `\nUsage: cd [DIR]...\nChange the cash working directory.\n\nChange the current directory to DIR.  The default DIR is the value of the\nHOME shell variable.\n\nReport cd bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/clear.js",
    "content": "module.exports = `\nUsage: clear\nClear the terminal screen\n\n      --help        display this help and exit\n\nClear ignores any command-line parameters that may be present.\n\nReport clear bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/cp.js",
    "content": "module.exports = `\nUsage: cp [OPTION]... [-T] SOURCE DEST\n  or:  cp [OPTION]... SOURCE... DIRECTORY\nCopy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\n  -f, --force           if an existing destination file cannot be\n                          opened, remove it and try again (this option\n                          is ignored when the -n option is also used)\n  -n, --no-clobber      do not overwrite an existing file (overrides\n                          a previous -i option)\n  -R, -r, --recursive   copy directories recursively\n      --help            display this help and exit\n\nReport cp bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/echo.js",
    "content": "module.exports = `\nUsage: echo [OPTION]... [ARG ...]\nWrite arguments to the standard output.\n\nDisplay the ARGs, separated by a single space character and followed by a\nnewline, on the standard output.\n\n  -e           enable interpretation of the following backslash escapes\n  -e           explicitly suppress interpretation of backslash escapes\n      --help   display this help and exit\n\n  \\`echo' interprets the following backslash-escaped characters:\n    \\b         backspace\n    \\c         suppress further output\n    \\n         new line\n    \\r         carriage return\n    \\t         horizontal tab\n    \\\\         backslash\n\nReport echo bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/export.js",
    "content": "module.exports = `\nUsage: export [OPTION] [name[=value]]\nExport variables into the environment\n\nWithout arguments, \\`export' prints the list of environnmental variables in the\nform \\`declare -x NAME=\"VALUE\"' on standard output. This is the same as the\nbehavior if \\`-p' is given.\n\nOtherwise, the variable is exported to the environment. If the variable has\nalready been defined in the environment (ex. \\`PATH'), then this will either\nredefine its value or do nothing (if no value is passed in). If the variable is\nnot already in the environment, it will be added with the \\`VALUE' given\n(defaults to the empty string).\n\n  -p           print all exported variables in a reusable format\n      --help   display this help and exit\n\nReport export bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/false.js",
    "content": "module.exports = `\nUsage: false [OPTION]\nDo nothing, unsuccessfully\n\nThis command simply exits with status 1 (failure).\n\n      --help   display this help and exit\n\nReport false bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/grep.js",
    "content": "module.exports = `\nUsage: grep [OPTION]... PATTERN [FILE]...\nSearch for PATTERN in each FILE or standard input.\nPATTERN is, by default, a basic regular expression (BRE).\nExample: grep -i 'hello world' menu.h main.c\n\niwsvmbnHhqr\n\nRegexp selection and interpretation:\n  -i, --ignore-case         ignore case distinctions\n  -w, --word-regexp         force PATTERN to match only whole words\n\nMiscellaneous:\n  -s, --no-messages         suppress error messages\n  -v, --invert-match        select non-matching lines\n      --help                display this help and exit\n\nOutput control:\n  -n, --line-number         print line number with output lines\n  -H, --with-filename       print the file name for each match\n  -h, --no-filename         suppress the file name prefix on output\n  -q, --quiet, --silent     suppress all normal output\n  -r, --recursive           like --directories=recurse\n      --include <FILE_PATTERN>  search only files that match FILE_PATTERN\n\nWhen FILE is -, read standard input.  With no FILE, read . if a command-line\n-r is given, - otherwise.  If fewer than two FILEs are given, assume -h.\nExit status is 0 if any line is selected, 1 otherwise;\nif any error occurs and -q is not given, the exit status is 2.\n\nReport grep bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/head.js",
    "content": "module.exports = `\nUsage: head [OPTION]... [FILE]...\nPrint the first 10 lines of each FILE to standard output.\nWith more than one FILE, precede each with a header giving the file name.\nWith no FILE, or when FILE is -, read standard input.\n\n  -n, --lines <number>        output the last N lines, instead of the last 10\n  -q, --silent                suppresses printing of headers when multiple files\n                                are being examined\n  -v, --verbose               always output headers giving file names\n      --help                  display this help and exit\n\nReport head bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/kill.js",
    "content": "module.exports = `\nUsage: kill [OPTION] pid | jobspec ... or kill -l [sigspec]\nSend a signal to a job.\n\nSend the processes identified by PID or JOBSPEC the signal named by\nSIGSPEC or SIGNUM.  If neither SIGSPEC nor SIGNUM is present, then\nSIGTERM is assumed.\n\n  -s sig         SIG is a signal name\n  -n sig         SIG is a signal number\n  -l [sigspec]   list the signal names; if arguments follow \\`-l' they\n                 are assumed to be signal numbers for which names\n                 should be listed\n      --help     display this help and exit\n\nExit status:\n  0   if OK,\n  1   if an invalid option is given or an error occurs.\n\nReport kill bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/ls.js",
    "content": "module.exports = `\nUsage: ls [OPTION]... [FILE]...\nList information about the FILEs (the current directory by default).\nSort entries alphabetically if none of -tSU nor --sort is specified.\n\n  -a, --all                  do not ignore entries starting with .\n  -A, --almost-all           do not list implied . and ..\n  -d, --directory            list directory entries instead of contents,\n                               and do not dereference symbolic links\n  -f                         do not sort, enable -aU, disable -ls --color\n  -F, --classify             append indicator (one of */=>@|) to entries\n  -h, --human-readable       with -l, print sizes in human readable format\n  -i, --inode                print the index number of each file\n  -l                         use a long listing format\n  -q, --hide-control-chars   print ? instead of non graphic characters\n  -r, --reverse              reverse order while sorting\n  -R, --recursive            list subdirectories recursively\n  -S                         sort by file size\n  -t                         sort by modification time, newest first\n  -U                         do not sort; list entries in directory order\n  -w, --width=COLS           assume screen width instead of current value\n  -x                         list entries by lines instead of by columns\n  -1                         list one file per line\n      --help                 display this help and exit\n\nExit status:\n  0   if OK,\n  1   if minor problems (e.g., cannot access subdirectory),\n  2   if serious trouble (e.g., cannot access command-line argument).\n\nReport ls bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/mkdir.js",
    "content": "module.exports = `\nUsage: mkdir [OPTION]... DIRECTORY...\nCreate the DIRECTORY(ies), if they do not already exist.\n\n  -p, --parents     no error if existing, make parent directories as needed\n  -v, --verbose     print a message for each created directory\n      --help        display this help and exit\n\nReport mkdir bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/mv.js",
    "content": "module.exports = `\nUsage: mv [OPTION]... [-T] SOURCE DEST\n  or:  mv [OPTION]... SOURCE... DIRECTORY\n  or:  mv [OPTION]... -t DIRECTORY SOURCE...\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\n  -f, --force                  do not prompt before overwriting\n  -n, --no-clobber             do not overwrite an existing file\n      --striptrailingslashes   remove any trailing slashes from each SOURCE\n                                 argument\n  -v, --verbose                explain what is being done\n      --help                   display this help and exit\n\nIf you specify -f and -n, only -f takes effect.\n\nReport mv bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/pwd.js",
    "content": "module.exports = `\nUsage: pwd [-LP]\nPrint the name of the current working directory.\n\n      --help        display this help and exit\n\nExit status:\n  0   if OK,\n  1   if an invalid option is given or the current directory\n      cannot be read.\n\nReport pwd bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/rm.js",
    "content": "module.exports = `\nUsage: rm [OPTION]... FILE...\nRemove (unlink) the FILE(s).\n\n  -f, --force           ignore nonexistent files and arguments, never prompt\n  -r, -R, --recursive   remove directories and their contents recursively\n      --help            display this help and exit\n\nBy default, rm does not remove directories.  Use the --recursive (-r or -R)\noption to remove each listed directory, too, along with all of its contents.\n\nTo remove a file whose name starts with a '-', for example '-foo',\nuse one of these commands:\n  rm -- -foo\n  rm ./-foo\n\nNote that if you use rm to remove a file, it might be possible to recover\nsome of its contents, given sufficient expertise and/or time.\n\nReport rm bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/sort.js",
    "content": "module.exports = `\nUsage: sort [OPTION]... [FILE]...\nWrite sorted concatenation of all FILE(s) to standard output.\n\nOrdering options:\n  -M, --month-sort            compare (unknown) < 'JAN' < ... < 'DEC'\n  -h, --human-numeric-sort    compare human readable numbers (e.g., 2K 1G)\n  -n, --numeric-sort          compare according to string numerical value\n  -R, --random-sort           sort by random hash of keys\n  -r, --reverse               reverse the result of comparisons\n\nOther options:\n  -c, --check,\n      --check=diagnose-first  check for sorted input; do not sort\n  -o, --output=FILE           write result to FILE instead of standard output\n      --help                  display this help and exit\n\nWith no FILE, or when FILE is -, read standard input.\n\nReport sort bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/source.js",
    "content": "module.exports = `\nUsage: source FILENAME [ARGUMENTS...]\n  or:  . FILENAME [ARGUMENTS...]\nRead and execute commands from the filename argument in the current shell.\n\nWhen a script is run using source, it runs within the existing shell and any\nchange of directory or modified variables or aliases will persist after the\nscript completes. Scripts may contain any commands that cash supports.\n\n      --help   display this help and exit\n\nReport source bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/tail.js",
    "content": "module.exports = `\nUsage: tail [OPTION]... [FILE]...\nDisplay the last part of a file.\n\nPrint the last 10 lines of each FILE to standard output. With more\nthan one FILE, precede each with a header giving the file name.\n\n  -n, --lines <number>        output the last N lines, instead of the last 10\n  -q, --silent                suppresses printing of headers when multiple files\n                                are being examined\n  -v, --verbose               always output headers giving file names\n      --help                  display this help and exit\n\nReport tail bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/touch.js",
    "content": "module.exports = `\nUsage: touch [OPTION]... FILE...\nUpdate the access and modification times of each FILE to the current time.\n\nA FILE argument that does not exist is created empty, unless -c is\nsupplied.\n\n  -a                      change only the access time\n  -c, --no-create         do not create any files\n  -d, --date <STRING>     parse STRING and use it instead of current time\n  -m                      change only the modification time\n  -r, --reference <FILE>  use this file's times instead of current time\n      --time <WORD>       change the specified time:\n                            WORD is access, atime, or use: equivalent to -a\n                            WORD is modify or mtime: equivalent to -m\n      --help              display this help and exit\n\nReport touch bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/true.js",
    "content": "module.exports = `\nUsage: true [OPTION]\nDo nothing, successfully\n\nThis command simply exits with status 0 (success).\n\n      --help   display this help and exit\n\nReport true bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/unalias.js",
    "content": "module.exports = `\nUsage: unalias [OPTION] name ...\nRemove each name from the list of defined aliases.\n\n  -a           remove all alias definitions\n      --help   display this help and exit\n\nExit status:\n  0   if OK,\n  1   if a name is not an existing alias.\n\nReport unalias bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help/which.js",
    "content": "module.exports = `\nUsage: which COMMAND\nLook for COMMAND in $PATH.\n\n      --help                   display this help and exit\n\nReport which bugs to <https://github.com/dthree/cash>\nCash home page: <http://cash.js.org/>\n`;\n"
  },
  {
    "path": "src/help.js",
    "content": "'use strict';\n\nconst pad = require('./util/pad');\n\nconst commands = [\n  'alias [-p] [name=[value]]',\n  'cat [-AbeEnstTv] [files ...]',\n  'cd [dir]',\n  'clear',\n  'cp [-fnr] source ... dest',\n  'echo [-eE] [arg ...]',\n  'export [-p][id=[value]]',\n  'false',\n  'grep [-bHhinqsvw] [-m max] [--silent] [--include pattern] pattern [files ...]',\n  'head [-nqv] <files ...>',\n  'kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l',\n  'less [files ...]',\n  'ls [-aAdFhilQrRStUwx1] [paths ...]',\n  'mkdir [-pv] [directories ...]',\n  'mv [-fnv] source ... dest',\n  'pwd [files ...]',\n  'rm [-frR] [files ...]',\n  'sort [-chMnrR] [-o file] [files ...]',\n  'source filename [arguments...]',\n  'tail [options] <files ...>',\n  'touch [-acm] [-d date] [-r ref] [--time word] file ...',\n  'true',\n  'unalias [-a] name [names ...]',\n  'which [command]'\n];\n\nfunction chop(str, len) {\n  let res = String(str).slice(0, len - 2);\n  res = (res.length === len - 2) ? `${res}>` : res;\n  return res;\n}\n\nmodule.exports = function () {\n  const version = require('./../package.json').version;\n  let result = '';\n\n  result += `Cash, version ${version}\\n`;\n  result += `These shell commands are defined internally.  Type \\`help\\' to see this list.\\n`;\n  result += `Type \\`help name\\' to find out more about the function \\`name\\'.\\n`;\n  result += `Use \\`info cash\\' to find out more about the shell in general.\\n`;\n  result += `\\n`;\n\n  const half = Math.floor(commands.length / 2);\n  const width = Math.floor((process.stdout.columns - 3) / 2);\n  const lhalf = Math.ceil(commands.length / 2);\n  const padding = ((commands.length % 2) === 1) ? 1 : 0;\n  for (let i = 0; i < lhalf; ++i) {\n    const colA = pad(chop(commands[i], width), width);\n    const colB = pad(chop(commands[half + i + padding] || '', width), width);\n    const line = (i === lhalf - 1) ? '' : '\\n';\n    result += ` ${colA} ${colB}${line}`;\n  }\n\n  return result;\n};\n"
  },
  {
    "path": "src/index.js",
    "content": "'use strict';\n\nconst os = require('os');\nconst Vorpal = require('vorpal');\n\nconst commands = require('./../commands.json');\nconst help = require('./help');\nconst interfacer = require('./util/interfacer');\nconst delimiter = require('./delimiter.js');\nconst path = require('path');\nconst fs = require('fs');\nconst minimist = require('minimist');\n\nlet cmds;\n\nconst app = {\n\n  commands: commands.commands,\n\n  importedCommands: commands.importedCommands,\n\n  vorpal: new Vorpal(),\n\n  _cwd: process.cwd(),\n\n  _fatal: false,\n\n  export(str, cbk) {\n    // Is this a tagged template literal?\n    const tmpl = Array.isArray(str) && Array.isArray(str.raw);\n    cbk = tmpl && cbk || function () {};\n    const options = {\n      fatal: app._fatal || false\n    };\n    // Hook stdin, execute the command and\n    // then return it all.\n    const intercept = require('./util/intercept');\n    let out = '';\n    const unhook = intercept(function (str) {\n      out += `${str}\\n`;\n      return '';\n    });\n    let commands;\n    if (tmpl) {\n      // Render into a single string, inserting interpolated values.\n      const interpVals = [...arguments].slice(1);\n      let interpStr = str[0];\n      for (let i = 0, l = interpVals.length; i < l; i++) {\n        /* istanbul ignore next */\n        interpStr += `${interpVals[i]}${str[i + 1]}`;\n      }\n      // Split into lines.  Remove blank lines and comments (start with #)\n      commands = interpStr.split(/\\r\\n|\\r|\\n/).filter(command => {\n        return !(/^\\s*(?:#|$)/.test(command));\n      });\n    } else {\n      commands = [str];\n    }\n    commands.forEach(command => {\n      app.vorpal.execSync(command, options);\n    });\n    unhook();\n    return String(out).replace(/\\n$/, '');\n  },\n\n  load() {\n    const self = this;\n    self.vorpal.api = {};\n    this.commands.forEach(function (cmd) {\n      if (self.importedCommands.indexOf(cmd) > -1) {\n        return;\n      }\n      try {\n        const mod = require(`./commands/${cmd}.js`);\n        let help;\n        try {\n          help = require(`./help/${cmd}.js`);\n          help = String(help).replace(/^\\n|\\n$/g, '');\n        } catch (e) {\n          // .. whatever\n        }\n        self.vorpal.use(mod, {\n          parent: self\n        });\n        const cmdObj = self.vorpal.find(cmd);\n        if (cmdObj && help) {\n          /* istanbul ignore next */\n          cmdObj.help(function (args, cb) {\n            cb(help);\n          });\n        }\n      } catch (e) {\n        /* istanbul ignore next */\n        self.vorpal.log(`Error loading command ${cmd}: `, e);\n      }\n    });\n    this.importedCommands.forEach(function (cmd) {\n      try {\n        const mod = require(`vorpal-${cmd}`);\n        self.vorpal.use(mod, {\n          parent: self\n        });\n      } catch (e) {\n        /* istanbul ignore next */\n        self.vorpal.log(`Error loading command ${cmd}: `, e);\n      }\n    });\n\n    // If we're running Windows, register\n    // process spawning for Windows child processes.\n    // If on Linux, just does registers the .catch command.\n    const windows = require('./windows');\n    windows.registerCommands(self);\n\n    for (const cmd in app.vorpal.api) {\n      if (app.vorpal.api.hasOwnProperty(cmd)) {\n        app.export[cmd] = function (args, options, callback) {\n          callback = callback || function () {};\n          options = options || {};\n          options.vorpal = app.vorpal;\n          return interfacer.call(this, {\n            command: app.vorpal.api[cmd],\n            args,\n            options,\n            callback,\n            async: app.vorpal.api[cmd].async || false,\n            silent: true\n          });\n        };\n      }\n    }\n\n    self.vorpal.localEnv = Object.create(process.env);\n    const argv = minimist(process.argv.slice(2));\n\n    /* istanbul ignore next */\n    if (typeof argv.c !== 'undefined' && typeof argv.c !== 'string') {\n      console.error('cash: -c: option requires an argument');\n      process.exit(2);\n    } else if (typeof argv.c === 'string' || argv._.length > 0) {\n      for (let k = 0; k < argv._.length; k++) {\n        self.vorpal.localEnv.k = argv._[k];\n      }\n      // If -c is used, use that string, otherwise use the script-name instead\n      const script = argv.c || `source ${argv._[0]}`;\n      app.vorpal.execSync(script);\n      process.exit(0);\n    }\n\n    // Otherwise, start an interactive shell\n    self.vorpal.localEnv[0] = 'cash';\n\n    app.vorpal\n      .history('cash')\n      .localStorage('cash')\n      .help(help);\n\n    app.vorpal\n      .find('exit')\n      .action(function () {\n        /* istanbul ignore next */\n        process.exit();\n      });\n\n    // Load aliases\n    let all;\n    try {\n      all = JSON.parse(app.vorpal.localStorage.getItem('aliases') || []);\n    } catch (e) {\n      /* istanbul ignore next */\n      all = [];\n      /* istanbul ignore next */\n      app.vorpal.localStorage.removeItem('aliases');\n    }\n    const aliases = {};\n    /* istanbul ignore next */\n    for (let i = 0; i < all.length; ++i) {\n      const item = app.vorpal.localStorage.getItem(`alias|${all[i]}`);\n      if (item !== undefined && item !== null) {\n        aliases[all[i]] = item;\n      }\n    }\n    app.vorpal._aliases = aliases;\n\n    // Override SIGINT to be ignored,\n    // and if the user is insistent, give\n    // a helpful message. The purpose of this\n    // is to give a full shell feel, not an\n    // application running over the shell.\n    // Skip this on linux, as its mainly\n    // for dev testing.\n    /* istanbul ignore next */\n    if (os.platform().indexOf('win') > -1) {\n      let counter = 0;\n      setInterval(function () {\n        counter = (counter > 0) ? 0 : counter;\n      }, 3000);\n      app.vorpal.sigint(function () {\n        counter++;\n        app.vorpal.ui.submit('');\n        if (counter > 5) {\n          app.vorpal.log('(to quit Cash, use the \"exit\" command)');\n          counter -= 10000;\n        }\n        return;\n      });\n    }\n\n    // Load .cashrc upon startup\n    let locations = ['.cashrc'];\n    if (process.platform === 'win32') {\n      /* istanbul ignore next */\n      locations.push('_cashrc');\n    }\n    locations = locations.map(function (str) {\n      return path.join(delimiter.getHomeDir(), str);\n    });\n\n    for (let i = 0; i < locations.length; ++i) {\n      try {\n        /* istanbul ignore if */\n        if (!fs.statSync(locations[i]).isDirectory()) {\n          app.vorpal.execSync(`source ${locations[i]}`);\n          break;\n        }\n      } catch (e) {\n        // File doesn't exist, so just don't load defaults\n      }\n    }\n\n    app.export.vorpal = app.vorpal;\n    Object.assign(app.export, cmds);\n    return this;\n  }\n};\n\ncmds = {\n  /* istanbul ignore next */\n  show() {\n    /* istanbul ignore next */\n    app.vorpal.show();\n  }\n};\n\napp.load();\n\nmodule.exports = app.export;\n"
  },
  {
    "path": "src/lib/sugar.js",
    "content": "/*\n *  Sugar Library v1.4.1\n *\n *  Freely distributable and licensed under the MIT-style license.\n *  Copyright (c) 2014 Andrew Plummer\n *  http://sugarjs.com/\n *\n * ---------------------------- */\n/* istanbul ignore next */\n(function(){function aa(a){return function(){return a}}\n/* istanbul ignore next */\nvar m=Object,p=Array,q=RegExp,r=Date,s=String,t=Number,u=Math,ba=\"undefined\"!==typeof global?global:this,v=m.prototype.toString,da=m.prototype.hasOwnProperty,ea=m.defineProperty&&m.defineProperties,fa=\"function\"===typeof q(),ga=!(\"0\"in new s(\"a\")),ia={},ja=/^\\[object Date|Array|String|Number|RegExp|Boolean|Arguments\\]$/,w=\"Boolean Number String Array Date RegExp Function\".split(\" \"),la=ka(\"boolean\",w[0]),y=ka(\"number\",w[1]),z=ka(\"string\",w[2]),A=ma(w[3]),C=ma(w[4]),D=ma(w[5]),F=ma(w[6]);\n/* istanbul ignore next */\nfunction ma(a){var b=\"Array\"===a&&p.isArray||function(b,d){return(d||v.call(b))===\"[object \"+a+\"]\"};return ia[a]=b}function ka(a,b){function c(c){return G(c)?v.call(c)===\"[object \"+b+\"]\":typeof c===a}return ia[b]=c}\nfunction na(a){a.SugarMethods||(oa(a,\"SugarMethods\",{}),H(a,!1,!0,{extend:function(b,c,d){H(a,!1!==d,c,b)},sugarRestore:function(){return pa(this,a,arguments,function(a,c,d){oa(a,c,d.method)})},sugarRevert:function(){return pa(this,a,arguments,function(a,c,d){d.existed?oa(a,c,d.original):delete a[c]})}}))}function H(a,b,c,d){var e=b?a.prototype:a;na(a);I(d,function(d,f){var h=e[d],l=J(e,d);F(c)&&h&&(f=qa(h,f,c));!1===c&&h||oa(e,d,f);a.SugarMethods[d]={method:f,existed:l,original:h,instance:b}})}\nfunction K(a,b,c,d,e){var g={};d=z(d)?d.split(\",\"):d;d.forEach(function(a,b){e(g,a,b)});H(a,b,c,g)}function pa(a,b,c,d){var e=0===c.length,g=L(c),f=!1;I(b.SugarMethods,function(b,c){if(e||-1!==g.indexOf(b))f=!0,d(c.instance?a.prototype:a,b,c)});return f}function qa(a,b,c){return function(d){return c.apply(this,arguments)?b.apply(this,arguments):a.apply(this,arguments)}}function oa(a,b,c){ea?m.defineProperty(a,b,{value:c,configurable:!0,enumerable:!1,writable:!0}):a[b]=c}\nfunction L(a,b,c){var d=[];c=c||0;var e;for(e=a.length;c<e;c++)d.push(a[c]),b&&b.call(a,a[c],c);return d}function sa(a,b,c){var d=a[c||0];A(d)&&(a=d,c=0);L(a,b,c)}function ta(a){if(!a||!a.call)throw new TypeError(\"Callback is not callable\");}function M(a){return void 0!==a}function N(a){return void 0===a}function J(a,b){return!!a&&da.call(a,b)}function G(a){return!!a&&(\"object\"===typeof a||fa&&D(a))}function ua(a){var b=typeof a;return null==a||\"string\"===b||\"number\"===b||\"boolean\"===b}\nfunction va(a,b){b=b||v.call(a);try{if(a&&a.constructor&&!J(a,\"constructor\")&&!J(a.constructor.prototype,\"isPrototypeOf\"))return!1}catch(c){return!1}return!!a&&\"[object Object]\"===b&&\"hasOwnProperty\"in a}function I(a,b){for(var c in a)if(J(a,c)&&!1===b.call(a,c,a[c],a))break}function wa(a,b){for(var c=0;c<a;c++)b(c)}function xa(a,b){I(b,function(c){a[c]=b[c]});return a}function ya(a){ua(a)&&(a=m(a));if(ga&&z(a))for(var b=a,c=0,d;d=b.charAt(c);)b[c++]=d;return a}function O(a){xa(this,ya(a))}\nO.prototype.constructor=m;var P=u.abs,za=u.pow,Aa=u.ceil,Q=u.floor,R=u.round,Ca=u.min,S=u.max;function Da(a,b,c){var d=za(10,P(b||0));c=c||R;0>b&&(d=1/d);return c(a*d)/d}var Ea=48,Fa=57,Ga=65296,Ha=65305,Ia=\".\",Ja=\"\",Ka={},La;function Ma(){return\"\\t\\n\\x0B\\f\\r \\u00a0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u2028\\u2029\\u3000\\ufeff\"}function Na(a,b){var c=\"\";for(a=a.toString();0<b;)if(b&1&&(c+=a),b>>=1)a+=a;return c}\nfunction Oa(a,b){var c,d;c=a.replace(La,function(a){a=Ka[a];a===Ia&&(d=!0);return a});return d?parseFloat(c):parseInt(c,b||10)}function T(a,b,c,d){d=P(a).toString(d||10);d=Na(\"0\",b-d.replace(/\\.\\d+/,\"\").length)+d;if(c||0>a)d=(0>a?\"-\":\"+\")+d;return d}function Pa(a){if(11<=a&&13>=a)return\"th\";switch(a%10){case 1:return\"st\";case 2:return\"nd\";case 3:return\"rd\";default:return\"th\"}}\nfunction Qa(a,b){function c(a,c){if(a||-1<b.indexOf(c))d+=c}var d=\"\";b=b||\"\";c(a.multiline,\"m\");c(a.ignoreCase,\"i\");c(a.global,\"g\");c(a.u,\"y\");return d}function Ra(a){z(a)||(a=s(a));return a.replace(/([\\\\/\\'*+?|()\\[\\]{}.^$])/g,\"\\\\$1\")}function U(a,b){return a[\"get\"+(a._utc?\"UTC\":\"\")+b]()}function Sa(a,b,c){return a[\"set\"+(a._utc&&\"ISOWeek\"!=b?\"UTC\":\"\")+b](c)}\nfunction Ta(a,b){var c=typeof a,d,e,g,f,h,l,n;if(\"string\"===c)return a;g=v.call(a);d=va(a,g);e=A(a,g);if(null!=a&&d||e){b||(b=[]);if(1<b.length)for(l=b.length;l--;)if(b[l]===a)return\"CYC\";b.push(a);d=a.valueOf()+s(a.constructor);f=e?a:m.keys(a).sort();l=0;for(n=f.length;l<n;l++)h=e?l:f[l],d+=h+Ta(a[h],b);b.pop()}else d=-Infinity===1/a?\"-0\":s(a&&a.valueOf?a.valueOf():a);return c+g+d}function Ua(a,b){return a===b?0!==a||1/a===1/b:Va(a)&&Va(b)?Ta(a)===Ta(b):!1}\nfunction Va(a){var b=v.call(a);return ja.test(b)||va(a,b)}function Wa(a,b,c){var d,e=a.length,g=b.length,f=!1!==b[g-1];if(!(g>(f?1:2)))return Xa(a,e,b[0],f,c);d=[];L(b,function(b){if(la(b))return!1;d.push(Xa(a,e,b,f,c))});return d}function Xa(a,b,c,d,e){d&&(c%=b,0>c&&(c=b+c));return e?a.charAt(c):a[c]}function Ya(a,b){K(b,!0,!1,a,function(a,b){a[b+(\"equal\"===b?\"s\":\"\")]=function(){return m[b].apply(null,[this].concat(L(arguments)))}})}na(m);I(w,function(a,b){na(ba[b])});var Za,$a;\nfor($a=0;9>=$a;$a++)Za=s.fromCharCode($a+Ga),Ja+=Za,Ka[Za]=s.fromCharCode($a+Ea);Ka[\",\"]=\"\";Ka[\"\\uff0e\"]=Ia;Ka[Ia]=Ia;La=q(\"[\"+Ja+\"\\uff0e,\"+Ia+\"]\",\"g\");\n\"use strict\";H(m,!1,!1,{keys:function(a){var b=[];if(!G(a)&&!D(a)&&!F(a))throw new TypeError(\"Object required\");I(a,function(a){b.push(a)});return b}});\nfunction ab(a,b,c,d){var e=a.length,g=-1==d,f=g?e-1:0;c=isNaN(c)?f:parseInt(c>>0);0>c&&(c=e+c);if(!g&&0>c||g&&c>=e)c=f;for(;g&&0<=c||!g&&c<e;){if(a[c]===b)return c;c+=d}return-1}function bb(a,b,c,d){var e=a.length,g=0,f=M(c);ta(b);if(0!=e||f)f||(c=a[d?e-1:g],g++);else throw new TypeError(\"Reduce called on empty array with no initial value\");for(;g<e;)f=d?e-g-1:g,f in a&&(c=b(c,a[f],f,a)),g++;return c}function cb(a){if(0===a.length)throw new TypeError(\"First argument must be defined\");}H(p,!1,!1,{isArray:function(a){return A(a)}});\nH(p,!0,!1,{every:function(a,b){var c=this.length,d=0;for(cb(arguments);d<c;){if(d in this&&!a.call(b,this[d],d,this))return!1;d++}return!0},some:function(a,b){var c=this.length,d=0;for(cb(arguments);d<c;){if(d in this&&a.call(b,this[d],d,this))return!0;d++}return!1},map:function(a,b){b=arguments[1];var c=this.length,d=0,e=Array(c);for(cb(arguments);d<c;)d in this&&(e[d]=a.call(b,this[d],d,this)),d++;return e},filter:function(a){var b=arguments[1],c=this.length,d=0,e=[];for(cb(arguments);d<c;)d in\nthis&&a.call(b,this[d],d,this)&&e.push(this[d]),d++;return e},indexOf:function(a,b){return z(this)?this.indexOf(a,b):ab(this,a,b,1)},lastIndexOf:function(a,b){return z(this)?this.lastIndexOf(a,b):ab(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(ta(a);d<c;)d in this&&a.call(b,this[d],d,this),d++},reduce:function(a,b){return bb(this,a,b)},reduceRight:function(a,b){return bb(this,a,b,!0)}});\nH(Function,!0,!1,{bind:function(a){var b=this,c=L(arguments,null,1),d;if(!F(this))throw new TypeError(\"Function.prototype.bind called on a non-function\");d=function(){return b.apply(b.prototype&&this instanceof b?this:a,c.concat(L(arguments)))};d.prototype=this.prototype;return d}});H(r,!1,!1,{now:function(){return(new r).getTime()}});\n(function(){var a=Ma().match(/^\\s+$/);try{s.prototype.trim.call([1])}catch(b){a=!1}H(s,!0,!a,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(q(\"^[\"+Ma()+\"]+\"),\"\")},trimRight:function(){return this.replace(q(\"[\"+Ma()+\"]+$\"),\"\")}})})();\n(function(){var a=new r(r.UTC(1999,11,31)),a=a.toISOString&&\"1999-12-31T00:00:00.000Z\"===a.toISOString();K(r,!0,!a,\"toISOString,toJSON\",function(a,c){a[c]=function(){return T(this.getUTCFullYear(),4)+\"-\"+T(this.getUTCMonth()+1,2)+\"-\"+T(this.getUTCDate(),2)+\"T\"+T(this.getUTCHours(),2)+\":\"+T(this.getUTCMinutes(),2)+\":\"+T(this.getUTCSeconds(),2)+\".\"+T(this.getUTCMilliseconds(),3)+\"Z\"}})})();\n\"use strict\";\nvar W,Ib,Jb=\"ampm hour minute second ampm utc offset_sign offset_hours offset_minutes ampm\".split(\" \"),Kb=\"({t})?\\\\s*(\\\\d{1,2}(?:[,.]\\\\d+)?)(?:{h}([0-5]\\\\d(?:[,.]\\\\d+)?)?{m}(?::?([0-5]\\\\d(?:[,.]\\\\d+)?){s})?\\\\s*(?:({t})|(Z)|(?:([+-])(\\\\d{2,2})(?::?(\\\\d{2,2}))?)?)?|\\\\s*({t}))\",Lb={},Mb,Nb,Ob,Pb=[],Qb={},X={yyyy:function(a){return U(a,\"FullYear\")},yy:function(a){return U(a,\"FullYear\")%100},ord:function(a){a=U(a,\"Date\");return a+Pa(a)},tz:function(a){return a.getUTCOffset()},isotz:function(a){return a.getUTCOffset(!0)},\nZ:function(a){return a.getUTCOffset()},ZZ:function(a){return a.getUTCOffset().replace(/(\\d{2})$/,\":$1\")}},Rb=[{name:\"year\",method:\"FullYear\",k:!0,b:function(a){return 864E5*(365+(a?a.isLeapYear()?1:0:0.25))}},{name:\"month\",error:0.919,method:\"Month\",k:!0,b:function(a,b){var c=30.4375,d;a&&(d=a.daysInMonth(),b<=d.days()&&(c=d));return 864E5*c}},{name:\"week\",method:\"ISOWeek\",b:aa(6048E5)},{name:\"day\",error:0.958,method:\"Date\",k:!0,b:aa(864E5)},{name:\"hour\",method:\"Hours\",b:aa(36E5)},{name:\"minute\",\nmethod:\"Minutes\",b:aa(6E4)},{name:\"second\",method:\"Seconds\",b:aa(1E3)},{name:\"millisecond\",method:\"Milliseconds\",b:aa(1)}],Sb={};function Tb(a){xa(this,a);this.g=Pb.concat()}\nTb.prototype={getMonth:function(a){return y(a)?a-1:this.months.indexOf(a)%12},getWeekday:function(a){return this.weekdays.indexOf(a)%7},addFormat:function(a,b,c,d,e){var g=c||[],f=this,h;a=a.replace(/\\s+/g,\"[,. ]*\");a=a.replace(/\\{([^,]+?)\\}/g,function(a,b){var d,e,h,B=b.match(/\\?$/);h=b.match(/^(\\d+)\\??$/);var k=b.match(/(\\d)(?:-(\\d))?/),E=b.replace(/[^a-z]+$/,\"\");h?d=f.tokens[h[1]]:f[E]?d=f[E]:f[E+\"s\"]&&(d=f[E+\"s\"],k&&(e=[],d.forEach(function(a,b){var c=b%(f.units?8:d.length);c>=k[1]&&c<=(k[2]||\nk[1])&&e.push(a)}),d=e),d=Ub(d));h?h=\"(?:\"+d+\")\":(c||g.push(E),h=\"(\"+d+\")\");B&&(h+=\"?\");return h});b?(b=Vb(f,e),e=[\"t\",\"[\\\\s\\\\u3000]\"].concat(f.timeMarker),h=a.match(/\\\\d\\{\\d,\\d\\}\\)+\\??$/),Wb(f,\"(?:\"+b+\")[,\\\\s\\\\u3000]+?\"+a,Jb.concat(g),d),Wb(f,a+\"(?:[,\\\\s]*(?:\"+e.join(\"|\")+(h?\"+\":\"*\")+\")\"+b+\")?\",g.concat(Jb),d)):Wb(f,a,g,d)}};\nfunction Xb(a,b,c){var d,e,g=b[0],f=b[1],h=b[2];b=a[c]||a.relative;if(F(b))return b.call(a,g,f,h,c);e=a.units[8*(a.plural&&1<g?1:0)+f]||a.units[f];a.capitalizeUnit&&(e=Yb(e));d=a.modifiers.filter(function(a){return\"sign\"==a.name&&a.value==(0<h?1:-1)})[0];return b.replace(/\\{(.*?)\\}/g,function(a,b){switch(b){case \"num\":return g;case \"unit\":return e;case \"sign\":return d.src}})}function Zb(a,b){b=b||a.code;return\"en\"===b||\"en-US\"===b?!0:a.variant}\nfunction $b(a,b){return b.replace(q(a.num,\"g\"),function(b){return ac(a,b)||\"\"})}function ac(a,b){var c;return y(b)?b:b&&-1!==(c=a.numbers.indexOf(b))?(c+1)%10:1}function Y(a,b){var c;z(a)||(a=\"\");c=Sb[a]||Sb[a.slice(0,2)];if(!1===b&&!c)throw new TypeError(\"Invalid locale.\");return c||Ib}\nfunction bc(a,b){function c(a){var b=h[a];z(b)?h[a]=b.split(\",\"):b||(h[a]=[])}function d(a,b){a=a.split(\"+\").map(function(a){return a.replace(/(.+):(.+)$/,function(a,b,c){return c.split(\"|\").map(function(a){return b+a}).join(\"|\")})}).join(\"|\");a.split(\"|\").forEach(b)}function e(a,b,c){var e=[];h[a].forEach(function(a,f){b&&(a+=\"+\"+a.slice(0,3));d(a,function(a,b){e[b*c+f]=a.toLowerCase()})});h[a]=e}function g(a,b,c){a=\"\\\\d{\"+a+\",\"+b+\"}\";c&&(a+=\"|(?:\"+Ub(h.numbers)+\")+\");return a}function f(a,b){h[a]=\nh[a]||b}var h,l;h=new Tb(b);c(\"modifiers\");\"months weekdays units numbers articles tokens timeMarker ampm timeSuffixes dateParse timeParse\".split(\" \").forEach(c);l=!h.monthSuffix;e(\"months\",l,12);e(\"weekdays\",l,7);e(\"units\",!1,8);e(\"numbers\",!1,10);f(\"code\",a);f(\"date\",g(1,2,h.digitDate));f(\"year\",\"'\\\\d{2}|\"+g(4,4));f(\"num\",function(){var a=[\"-?\\\\d+\"].concat(h.articles);h.numbers&&(a=a.concat(h.numbers));return Ub(a)}());(function(){var a=[];h.i={};h.modifiers.push({name:\"day\",src:\"yesterday\",value:-1});\nh.modifiers.push({name:\"day\",src:\"today\",value:0});h.modifiers.push({name:\"day\",src:\"tomorrow\",value:1});h.modifiers.forEach(function(b){var c=b.name;d(b.src,function(d){var e=h[c];h.i[d]=b;a.push({name:c,src:d,value:b.value});h[c]=e?e+\"|\"+d:d})});h.day+=\"|\"+Ub(h.weekdays);h.modifiers=a})();h.monthSuffix&&(h.month=g(1,2),h.months=\"1 2 3 4 5 6 7 8 9 10 11 12\".split(\" \").map(function(a){return a+h.monthSuffix}));h.full_month=g(1,2)+\"|\"+Ub(h.months);0<h.timeSuffixes.length&&h.addFormat(Vb(h),!1,Jb);\nh.addFormat(\"{day}\",!0);h.addFormat(\"{month}\"+(h.monthSuffix||\"\"));h.addFormat(\"{year}\"+(h.yearSuffix||\"\"));h.timeParse.forEach(function(a){h.addFormat(a,!0)});h.dateParse.forEach(function(a){h.addFormat(a)});return Sb[a]=h}function Wb(a,b,c,d){a.g.unshift({r:d,locale:a,q:q(\"^\"+b+\"$\",\"i\"),to:c})}function Yb(a){return a.slice(0,1).toUpperCase()+a.slice(1)}function Ub(a){return a.filter(function(a){return!!a}).join(\"|\")}function cc(){var a=r.SugarNewDate;return a?a():new r}\nfunction dc(a,b){var c;if(G(a[0]))return a;if(y(a[0])&&!y(a[1]))return[a[0]];if(z(a[0])&&b)return[ec(a[0]),a[1]];c={};Nb.forEach(function(b,e){c[b.name]=a[e]});return[c]}function ec(a){var b,c={};if(a=a.match(/^(\\d+)?\\s?(\\w+?)s?$/i))N(b)&&(b=parseInt(a[1])||1),c[a[2].toLowerCase()]=b;return c}function fc(a,b,c){var d;N(c)&&(c=Ob.length);for(b=b||0;b<c&&(d=Ob[b],!1!==a(d.name,d,b));b++);}\nfunction gc(a,b){var c={},d,e;b.forEach(function(b,f){d=a[f+1];N(d)||\"\"===d||(\"year\"===b&&(c.t=d.replace(/'/,\"\")),e=parseFloat(d.replace(/'/,\"\").replace(/,/,\".\")),c[b]=isNaN(e)?d.toLowerCase():e)});return c}function hc(a){a=a.trim().replace(/^just (?=now)|\\.+$/i,\"\");return ic(a)}\nfunction ic(a){return a.replace(Mb,function(a,c,d){var e=0,g=1,f,h;if(c)return a;d.split(\"\").reverse().forEach(function(a){a=Lb[a];var b=9<a;b?(f&&(e+=g),g*=a/(h||1),h=a):(!1===f&&(g*=10),e+=g*a);f=b});f&&(e+=g);return e})}\nfunction jc(a,b,c,d){function e(a){vb.push(a)}function g(){vb.forEach(function(a){a.call()})}function f(){var a=n.getWeekday();n.setWeekday(7*(k.num-1)+(a>Ba?Ba+7:Ba))}function h(){var a=B.i[k.edge];fc(function(a){if(M(k[a]))return E=a,!1},4);if(\"year\"===E)k.e=\"month\";else if(\"month\"===E||\"week\"===E)k.e=\"day\";n[(0>a.value?\"endOf\":\"beginningOf\")+Yb(E)]();-2===a.value&&n.reset()}function l(){var a;fc(function(b,c,d){\"day\"===b&&(b=\"date\");if(M(k[b])){if(d>=wb)return n.setTime(NaN),!1;a=a||{};a[b]=k[b];\ndelete k[b]}});a&&e(function(){n.set(a,!0)})}var n,x,ha,vb,B,k,E,wb,Ba,ra,ca;n=cc();vb=[];n.utc(d);C(a)?n.utc(a.isUTC()).setTime(a.getTime()):y(a)?n.setTime(a):G(a)?(n.set(a,!0),k=a):z(a)&&(ha=Y(b),a=hc(a),ha&&I(ha.o?[ha.o].concat(ha.g):ha.g,function(c,d){var g=a.match(d.q);if(g){B=d.locale;k=gc(g,d.to);B.o=d;k.utc&&n.utc();if(k.timestamp)return k=k.timestamp,!1;d.r&&(!z(k.month)&&(z(k.date)||Zb(ha,b)))&&(ca=k.month,k.month=k.date,k.date=ca);k.year&&2===k.t.length&&(k.year=100*R(U(cc(),\"FullYear\")/\n100)-100*R(k.year/100)+k.year);k.month&&(k.month=B.getMonth(k.month),k.shift&&!k.unit&&(k.unit=B.units[7]));k.weekday&&k.date?delete k.weekday:k.weekday&&(k.weekday=B.getWeekday(k.weekday),k.shift&&!k.unit&&(k.unit=B.units[5]));k.day&&(ca=B.i[k.day])?(k.day=ca.value,n.reset(),x=!0):k.day&&-1<(Ba=B.getWeekday(k.day))&&(delete k.day,k.num&&k.month?(e(f),k.day=1):k.weekday=Ba);k.date&&!y(k.date)&&(k.date=$b(B,k.date));k.ampm&&k.ampm===B.ampm[1]&&12>k.hour?k.hour+=12:k.ampm===B.ampm[0]&&12===k.hour&&\n(k.hour=0);if(\"offset_hours\"in k||\"offset_minutes\"in k)n.utc(),k.offset_minutes=k.offset_minutes||0,k.offset_minutes+=60*k.offset_hours,\"-\"===k.offset_sign&&(k.offset_minutes*=-1),k.minute-=k.offset_minutes;k.unit&&(x=!0,ra=ac(B,k.num),wb=B.units.indexOf(k.unit)%8,E=W.units[wb],l(),k.shift&&(ra*=(ca=B.i[k.shift])?ca.value:0),k.sign&&(ca=B.i[k.sign])&&(ra*=ca.value),M(k.weekday)&&(n.set({weekday:k.weekday},!0),delete k.weekday),k[E]=(k[E]||0)+ra);k.edge&&e(h);\"-\"===k.year_sign&&(k.year*=-1);fc(function(a,\nb,c){b=k[a];var d=b%1;d&&(k[Ob[c-1].name]=R(d*(\"second\"===a?1E3:60)),k[a]=Q(b))},1,4);return!1}}),k?x?n.advance(k):(n._utc&&n.reset(),kc(n,k,!0,!1,c)):(\"now\"!==a&&(n=new r(a)),d&&n.addMinutes(-n.getTimezoneOffset())),g(),n.utc(!1));return{c:n,set:k}}function lc(a){var b,c=P(a),d=c,e=0;fc(function(a,f,h){b=Q(Da(c/f.b(),1));1<=b&&(d=b,e=h)},1);return[d,e,a]}\nfunction mc(a){var b=lc(a.millisecondsFromNow());if(6===b[1]||5===b[1]&&4===b[0]&&a.daysFromNow()>=cc().daysInMonth())b[0]=P(a.monthsFromNow()),b[1]=6;return b}function nc(a,b,c){function d(a,c){var d=U(a,\"Month\");return Y(c).months[d+12*b]}Z(a,d,c);Z(Yb(a),d,c,1)}function Z(a,b,c,d){X[a]=function(a,g){var f=b(a,g);c&&(f=f.slice(0,c));d&&(f=f.slice(0,d).toUpperCase()+f.slice(d));return f}}\nfunction oc(a,b,c){X[a]=b;X[a+a]=function(a,c){return T(b(a,c),2)};c&&(X[a+a+a]=function(a,c){return T(b(a,c),3)},X[a+a+a+a]=function(a,c){return T(b(a,c),4)})}function pc(a){var b=a.match(/(\\{\\w+\\})|[^{}]+/g);Qb[a]=b.map(function(a){a.replace(/\\{(\\w+)\\}/,function(b,e){a=X[e]||e;return e});return a})}\nfunction qc(a,b,c,d){var e;if(!a.isValid())return\"Invalid Date\";Date[b]?b=Date[b]:F(b)&&(e=mc(a),b=b.apply(a,e.concat(Y(d))));if(!b&&c)return e=e||mc(a),0===e[1]&&(e[1]=1,e[0]=1),a=Y(d),Xb(a,e,0<e[2]?\"future\":\"past\");b=b||\"long\";if(\"short\"===b||\"long\"===b||\"full\"===b)b=Y(d)[b];Qb[b]||pc(b);var g,f;e=\"\";b=Qb[b];g=0;for(c=b.length;g<c;g++)f=b[g],e+=F(f)?f(a,d):f;return e}\nfunction rc(a,b,c,d,e){var g,f,h,l=0,n=0,x=0;g=jc(b,c,null,e);0<d&&(n=x=d,f=!0);if(!g.c.isValid())return!1;if(g.set&&g.set.e){Rb.forEach(function(b){b.name===g.set.e&&(l=b.b(g.c,a-g.c)-1)});b=Yb(g.set.e);if(g.set.edge||g.set.shift)g.c[\"beginningOf\"+b]();\"month\"===g.set.e&&(h=g.c.clone()[\"endOf\"+b]().getTime());!f&&(g.set.sign&&\"millisecond\"!=g.set.e)&&(n=50,x=-50)}f=a.getTime();b=g.c.getTime();h=sc(a,b,h||b+l);return f>=b-n&&f<=h+x}\nfunction sc(a,b,c){b=new r(b);a=(new r(c)).utc(a.isUTC());23!==U(a,\"Hours\")&&(b=b.getTimezoneOffset(),a=a.getTimezoneOffset(),b!==a&&(c+=(a-b).minutes()));return c}\nfunction kc(a,b,c,d,e){function g(a){return M(b[a])?b[a]:b[a+\"s\"]}function f(a){return M(g(a))}var h;if(y(b)&&d)b={milliseconds:b};else if(y(b))return a.setTime(b),a;M(b.date)&&(b.day=b.date);fc(function(d,e,g){var l=\"day\"===d;if(f(d)||l&&f(\"weekday\"))return b.e=d,h=+g,!1;!c||(\"week\"===d||l&&f(\"week\"))||Sa(a,e.method,l?1:0)});Rb.forEach(function(c){var e=c.name;c=c.method;var h;h=g(e);N(h)||(d?(\"week\"===e&&(h=(b.day||0)+7*h,c=\"Date\"),h=h*d+U(a,c)):\"month\"===e&&f(\"day\")&&Sa(a,\"Date\",15),Sa(a,c,h),\nd&&\"month\"===e&&(e=h,0>e&&(e=e%12+12),e%12!=U(a,\"Month\")&&Sa(a,\"Date\",0)))});d||(f(\"day\")||!f(\"weekday\"))||a.setWeekday(g(\"weekday\"));var l;a:{switch(e){case -1:l=a>cc();break a;case 1:l=a<cc();break a}l=void 0}l&&fc(function(b,c){if((c.k||\"week\"===b&&f(\"weekday\"))&&!(f(b)||\"day\"===b&&f(\"weekday\")))return a[c.j](e),!1},h+1);return a}\nfunction Vb(a,b){var c=Kb,d={h:0,m:1,s:2},e;a=a||W;return c.replace(/{([a-z])}/g,function(c,f){var h=[],l=\"h\"===f,n=l&&!b;if(\"t\"===f)return a.ampm.join(\"|\");l&&h.push(\":\");(e=a.timeSuffixes[d[f]])&&h.push(e+\"\\\\s*\");return 0===h.length?\"\":\"(?:\"+h.join(\"|\")+\")\"+(n?\"\":\"?\")})}function tc(a,b,c){var d,e;y(a[1])?d=dc(a)[0]:(d=a[0],e=a[1]);return jc(d,e,b,c).c}\nH(r,!1,!0,{create:function(){return tc(arguments)},past:function(){return tc(arguments,-1)},future:function(){return tc(arguments,1)},addLocale:function(a,b){return bc(a,b)},setLocale:function(a){var b=Y(a,!1);Ib=b;a&&a!=b.code&&(b.code=a);return b},getLocale:function(a){return a?Y(a,!1):Ib},addFormat:function(a,b,c){Wb(Y(c),a,b)}});\nH(r,!0,!0,{set:function(){var a=dc(arguments);return kc(this,a[0],a[1])},setWeekday:function(a){if(!N(a))return Sa(this,\"Date\",U(this,\"Date\")+a-U(this,\"Day\"))},setISOWeek:function(a){var b=U(this,\"Day\")||7;if(!N(a))return this.set({month:0,date:4}),this.set({weekday:1}),1<a&&this.addWeeks(a-1),1!==b&&this.advance({days:b-1}),this.getTime()},getISOWeek:function(){var a;a=this.clone();var b=U(a,\"Day\")||7;a.addDays(4-b).reset();return 1+Q(a.daysSince(a.clone().beginningOfYear())/7)},beginningOfISOWeek:function(){var a=\nthis.getDay();0===a?a=-6:1!==a&&(a=1);this.setWeekday(a);return this.reset()},endOfISOWeek:function(){0!==this.getDay()&&this.setWeekday(7);return this.endOfDay()},getUTCOffset:function(a){var b=this._utc?0:this.getTimezoneOffset(),c=!0===a?\":\":\"\";return!b&&a?\"Z\":T(Q(-b/60),2,!0)+c+T(P(b%60),2)},utc:function(a){oa(this,\"_utc\",!0===a||0===arguments.length);return this},isUTC:function(){return!!this._utc||0===this.getTimezoneOffset()},advance:function(){var a=dc(arguments,!0);return kc(this,a[0],a[1],\n1)},rewind:function(){var a=dc(arguments,!0);return kc(this,a[0],a[1],-1)},isValid:function(){return!isNaN(this.getTime())},isAfter:function(a,b){return this.getTime()>r.create(a).getTime()-(b||0)},isBefore:function(a,b){return this.getTime()<r.create(a).getTime()+(b||0)},isBetween:function(a,b,c){var d=this.getTime();a=r.create(a).getTime();var e=r.create(b).getTime();b=Ca(a,e);a=S(a,e);c=c||0;return b-c<d&&a+c>d},isLeapYear:function(){var a=U(this,\"FullYear\");return 0===a%4&&0!==a%100||0===a%400},\ndaysInMonth:function(){return 32-U(new r(U(this,\"FullYear\"),U(this,\"Month\"),32),\"Date\")},format:function(a,b){return qc(this,a,!1,b)},relative:function(a,b){z(a)&&(b=a,a=null);return qc(this,a,!0,b)},is:function(a,b,c){var d,e;if(this.isValid()){if(z(a))switch(a=a.trim().toLowerCase(),e=this.clone().utc(c),!0){case \"future\"===a:return this.getTime()>cc().getTime();case \"past\"===a:return this.getTime()<cc().getTime();case \"weekday\"===a:return 0<U(e,\"Day\")&&6>U(e,\"Day\");case \"weekend\"===a:return 0===\nU(e,\"Day\")||6===U(e,\"Day\");case -1<(d=W.weekdays.indexOf(a)%7):return U(e,\"Day\")===d;case -1<(d=W.months.indexOf(a)%12):return U(e,\"Month\")===d}return rc(this,a,null,b,c)}},reset:function(a){var b={},c;a=a||\"hours\";\"date\"===a&&(a=\"days\");c=Rb.some(function(b){return a===b.name||a===b.name+\"s\"});b[a]=a.match(/^days?/)?1:0;return c?this.set(b,!0):this},clone:function(){var a=new r(this.getTime());a.utc(!!this._utc);return a}});\nH(r,!0,!0,{iso:function(){return this.toISOString()},getWeekday:r.prototype.getDay,getUTCWeekday:r.prototype.getUTCDay});function uc(a,b){function c(){return R(this*b)}function d(){return tc(arguments)[a.j](this)}function e(){return tc(arguments)[a.j](-this)}var g=a.name,f={};f[g]=c;f[g+\"s\"]=c;f[g+\"Before\"]=e;f[g+\"sBefore\"]=e;f[g+\"Ago\"]=e;f[g+\"sAgo\"]=e;f[g+\"After\"]=d;f[g+\"sAfter\"]=d;f[g+\"FromNow\"]=d;f[g+\"sFromNow\"]=d;t.extend(f)}H(t,!0,!0,{duration:function(a){a=Y(a);return Xb(a,lc(this),\"duration\")}});\nW=Ib=r.addLocale(\"en\",{plural:!0,timeMarker:\"at\",ampm:\"am,pm\",months:\"January,February,March,April,May,June,July,August,September,October,November,December\",weekdays:\"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\",units:\"millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s\",numbers:\"one,two,three,four,five,six,seven,eight,nine,ten\",articles:\"a,an,the\",tokens:\"the,st|nd|rd|th,of\",\"short\":\"{Month} {d}, {yyyy}\",\"long\":\"{Month} {d}, {yyyy} {h}:{mm}{tt}\",full:\"{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}\",\npast:\"{num} {unit} {sign}\",future:\"{num} {unit} {sign}\",duration:\"{num} {unit}\",modifiers:[{name:\"sign\",src:\"ago|before\",value:-1},{name:\"sign\",src:\"from now|after|from|in|later\",value:1},{name:\"edge\",src:\"last day\",value:-2},{name:\"edge\",src:\"end\",value:-1},{name:\"edge\",src:\"first day|beginning\",value:1},{name:\"shift\",src:\"last\",value:-1},{name:\"shift\",src:\"the|this\",value:0},{name:\"shift\",src:\"next\",value:1}],dateParse:[\"{month} {year}\",\"{shift} {unit=5-7}\",\"{0?} {date}{1}\",\"{0?} {edge} of {shift?} {unit=4-7?}{month?}{year?}\"],\ntimeParse:\"{num} {unit} {sign};{sign} {num} {unit};{0} {num}{1} {day} of {month} {year?};{weekday?} {month} {date}{1?} {year?};{date} {month} {year};{date} {month};{shift} {weekday};{shift} week {weekday};{weekday} {2?} {shift} week;{num} {unit=4-5} {sign} {day};{0?} {date}{1} of {month};{0?}{month?} {date?}{1?} of {shift} {unit=6-7}\".split(\";\")});Ob=Rb.concat().reverse();Nb=Rb.concat();Nb.splice(2,1);\nK(r,!0,!0,Rb,function(a,b,c){function d(a){a/=f;var c=a%1,d=b.error||0.999;c&&P(c%1)>d&&(a=R(a));return 0>a?Aa(a):Q(a)}var e=b.name,g=Yb(e),f=b.b(),h,l;b.j=\"add\"+g+\"s\";h=function(a,b){return d(this.getTime()-r.create(a,b).getTime())};l=function(a,b){return d(r.create(a,b).getTime()-this.getTime())};a[e+\"sAgo\"]=l;a[e+\"sUntil\"]=l;a[e+\"sSince\"]=h;a[e+\"sFromNow\"]=h;a[b.j]=function(a,b){var c={};c[e]=a;return this.advance(c,b)};uc(b,f);3>c&&[\"Last\",\"This\",\"Next\"].forEach(function(b){a[\"is\"+b+g]=function(){return rc(this,\nb+\" \"+e,\"en\")}});4>c&&(a[\"beginningOf\"+g]=function(){var a={};switch(e){case \"year\":a.year=U(this,\"FullYear\");break;case \"month\":a.month=U(this,\"Month\");break;case \"day\":a.day=U(this,\"Date\");break;case \"week\":a.weekday=0}return this.set(a,!0)},a[\"endOf\"+g]=function(){var a={hours:23,minutes:59,seconds:59,milliseconds:999};switch(e){case \"year\":a.month=11;a.day=31;break;case \"month\":a.day=this.daysInMonth();break;case \"week\":a.weekday=6}return this.set(a,!0)})});\nW.addFormat(\"([+-])?(\\\\d{4,4})[-.]?{full_month}[-.]?(\\\\d{1,2})?\",!0,[\"year_sign\",\"year\",\"month\",\"date\"],!1,!0);W.addFormat(\"(\\\\d{1,2})[-.\\\\/]{full_month}(?:[-.\\\\/](\\\\d{2,4}))?\",!0,[\"date\",\"month\",\"year\"],!0);W.addFormat(\"{full_month}[-.](\\\\d{4,4})\",!1,[\"month\",\"year\"]);W.addFormat(\"\\\\/Date\\\\((\\\\d+(?:[+-]\\\\d{4,4})?)\\\\)\\\\/\",!1,[\"timestamp\"]);W.addFormat(Vb(W),!1,Jb);Pb=W.g.slice(0,7).reverse();W.g=W.g.slice(7).concat(Pb);oc(\"f\",function(a){return U(a,\"Milliseconds\")},!0);\noc(\"s\",function(a){return U(a,\"Seconds\")});oc(\"m\",function(a){return U(a,\"Minutes\")});oc(\"h\",function(a){return U(a,\"Hours\")%12||12});oc(\"H\",function(a){return U(a,\"Hours\")});oc(\"d\",function(a){return U(a,\"Date\")});oc(\"M\",function(a){return U(a,\"Month\")+1});(function(){function a(a,c){var d=U(a,\"Hours\");return Y(c).ampm[Q(d/12)]||\"\"}Z(\"t\",a,1);Z(\"tt\",a);Z(\"T\",a,1,1);Z(\"TT\",a,null,2)})();\n/* istanbul ignore next */\n(function(){function a(a,c){var d=U(a,\"Day\");return Y(c).weekdays[d]}Z(\"dow\",a,3);Z(\"Dow\",a,3,1);Z(\"weekday\",a);Z(\"Weekday\",a,null,1)})();nc(\"mon\",0,3);nc(\"month\",0);nc(\"month2\",1);nc(\"month3\",2);X.ms=X.f;X.milliseconds=X.f;X.seconds=X.s;X.minutes=X.m;X.hours=X.h;X[\"24hr\"]=X.H;X[\"12hr\"]=X.h;X.date=X.d;X.day=X.d;X.year=X.yyyy;K(r,!0,!0,\"short,long,full\",function(a,b){a[b]=function(a){return qc(this,b,!1,a)}});\n\"\\u3007\\u4e00\\u4e8c\\u4e09\\u56db\\u4e94\\u516d\\u4e03\\u516b\\u4e5d\\u5341\\u767e\\u5343\\u4e07\".split(\"\").forEach(function(a,b){9<b&&(b=za(10,b-9));Lb[a]=b});xa(Lb,Ka);Mb=q(\"([\\u671f\\u9031\\u5468])?([\\u3007\\u4e00\\u4e8c\\u4e09\\u56db\\u4e94\\u516d\\u4e03\\u516b\\u4e5d\\u5341\\u767e\\u5343\\u4e07\"+Ja+\"]+)(?!\\u6628)\",\"g\");\n/* istanbul ignore next */\n(function(){var a=W.weekdays.slice(0,7),b=W.months.slice(0,12);K(r,!0,!0,\"today yesterday tomorrow weekday weekend future past\".split(\" \").concat(a).concat(b),function(a,b){a[\"is\"+Yb(b)]=function(a){return this.is(b,0,a)}})})();r.utc||(r.utc={create:function(){return tc(arguments,0,!0)},past:function(){return tc(arguments,-1,!0)},future:function(){return tc(arguments,1,!0)}});\nH(r,!1,!0,{RFC1123:\"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}\",RFC1036:\"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}\",ISO8601_DATE:\"{yyyy}-{MM}-{dd}\",ISO8601_DATETIME:\"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}\"});})();\n"
  },
  {
    "path": "src/preparser.js",
    "content": "'use strict';\n\n// Replace out env variables.\nconst parseEnvVariables = function (input) {\n  const referenceRegex =\n    /\\${([a-zA-Z_][a-zA-Z0-9_]*)}|\\$([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n  return input.replace(referenceRegex, function (varRef, capture1, capture2, capture3) {\n    const varName = capture1 || capture2 || capture3;\n    // Return the value of the variable, or the empty string if not there\n    return process.env.hasOwnProperty(varName) ? process.env[varName] : '';\n  });\n};\n\nconst preparser = function (input) {\n  input = parseEnvVariables(input);\n  return input;\n};\n\nmodule.exports = preparser;\n"
  },
  {
    "path": "src/util/colorFile.js",
    "content": "'use strict';\n\nconst strip = require('./stripAnsi');\n\nconst chalk = {};\nconst map = {cyan: 36, red: 31, magenta: 35};\nObject.keys(map).forEach(function (key, value) {\n  chalk[key] = function (str) {\n    return `\\u001b[${value}m${str}\\u001b[39m`;\n  };\n});\n\n/**\n * Wraps file strings in ANSI colors\n * based on their extension.\n *\n * @param {file} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (file) {\n  const audio = ['aac', 'au', 'flac', 'mid', 'midi', 'mka', 'mp3', 'mpc', 'ogg', 'ra', 'wav', 'axa', 'oga', 'spx', 'xspf'];\n  const archive = ['tar', 'tgz', 'arj', 'taz', 'lzh', 'lzma', 'tlz', 'txz', 'zip', 'z', 'Z', 'dz', 'gz', 'lz', 'xz', 'bz2', 'bz', 'tbz', 'tbz2', 'tz', 'deb', 'rpm', 'jar', 'rar', 'ace', 'zoo', 'cpio', '7z', 'rz'];\n  const images = ['jpg', 'jpeg', 'gif', 'bmp', 'pbm', 'pgm', 'ppm', 'tga', 'xbm', 'xpm', 'tif', 'tiff', 'png', 'svg', 'svgz', 'mng', 'pcx', 'mov', 'mpg', 'mpeg', 'm2v', 'mkv', 'ogm', 'mp4', 'm4v', 'mp4v', 'vob', 'qt', 'nuv', 'wmv', 'asf', 'rm', 'rmvb', 'flc', 'avi', 'fli', 'flv', 'gl', 'dl', 'xcf', 'xwd', 'yuv', 'cgm', 'emf', 'axv', 'anx', 'ogv', 'ogx'];\n\n  let extension = String(file).toLowerCase().trim().split('.');\n  extension = extension[extension.length - 1];\n\n  let colored = strip(file);\n  colored = (audio.indexOf(extension) > -1) ? chalk.cyan(file) :\n    (archive.indexOf(extension) > -1) ? chalk.red(file) :\n    (images.indexOf(extension) > -1) ? chalk.magenta(file) :\n    colored;\n\n  return colored;\n};\n"
  },
  {
    "path": "src/util/columnify.js",
    "content": "'use strict';\n\nconst strip = require('./stripAnsi');\nconst pad = require('./pad');\n\n/**\n * Formats an array to display in a TTY\n * in a pretty fashion.\n *\n * @param {Array} arr\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (arr, options) {\n  arr = arr || [];\n  options = options || {};\n  const bk = JSON.parse(JSON.stringify(arr));\n  const width = (options.width && !isNaN(options.width)) ?\n    options.width :\n    process.stdout.columns;\n  const longest = strip(bk.sort(function (a, b) {\n    return strip(b).length - strip(a).length;\n  })[0] || '').length + 2;\n  const fullWidth = strip(arr.join('')).length;\n  const fitsOneLine = ((fullWidth + (arr.length * 2)) <= width);\n  let cols = Math.floor(width / longest);\n  cols = (cols < 1) ? 1 : cols;\n  if (fitsOneLine) {\n    return arr.join('  ');\n  }\n  let col = 0;\n  const lines = [];\n  let line = '';\n  for (let i = 0; i < arr.length; ++i) {\n    if (col < cols) {\n      col++;\n    } else {\n      if (String(strip(line)).trim() !== '') {\n        lines.push(line);\n      }\n      line = '';\n      col = 1;\n    }\n    if (cols === 1) {\n      // If we have files so damn\n      // long that we wrap, don't pad\n      // the lines.\n      line += arr[i];\n    } else {\n      // Pad the lines based on the\n      // longest word.\n      /* istanbul ignore next */\n      line += pad(arr[i], longest, ' ');\n    }\n  }\n  if (line !== '') {\n    lines.push(line);\n  }\n  return lines.join('\\n');\n};\n"
  },
  {
    "path": "src/util/converter.date.js",
    "content": "'use strict';\n\n/**\n * Date conversion utilities\n */\n\nconst months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\nfunction pad(num, padding) {\n  padding = padding || '0';\n  num = parseFloat(num);\n  if (num < 10) {\n    return `${padding}${num}`;\n  }\n  return num;\n}\n\nmodule.exports = {\n\n  unix(dt) {\n    let date = dt;\n    let day = pad(date.getDate(), ' ');\n    const month = months[date.getMonth()];\n    const hour = pad(date.getHours());\n    const min = pad(date.getMinutes());\n    const hourMin = `${hour}:${min}`;\n    day = (day.length === 1) ? (` ${day}`) : day;\n    date = `${month} ${day} ${hourMin}`;\n    return date;\n  }\n};\n"
  },
  {
    "path": "src/util/converter.path.js",
    "content": "'use strict';\n\nconst path = require('path');\n\n/**\n * Path conversion utilities\n */\n\nmodule.exports = {\n\n  unix(str) {\n    let input = path.normalize(str);\n    input = input.replace(/\\\\/g, '\\/');\n    const parts = input.split(':');\n    const drive = parts.shift();\n    const isLetter = (drive.length === 1 && drive.match(/[a-z]/i));\n    const result = (isLetter) ? drive + parts.join(':') : input;\n    return result;\n  }\n};\n"
  },
  {
    "path": "src/util/converter.permissions.js",
    "content": "'use strict';\n\n/**\n * Permission conversion utilities\n */\n\nmodule.exports = {\n\n  listing: {\n    0: '---',\n    1: '--x',\n    2: '-w-',\n    3: '-wx',\n    4: 'r--',\n    5: 'r-x',\n    6: 'rw-',\n    7: 'rwx'\n  },\n\n  modeToRWX(mode) {\n    const octal = this.modeToOctal(mode);\n    const rwx = this.octalToRWX(octal);\n    return rwx;\n  },\n\n  modeToOctal(mode) {\n    const octal = `0${(mode & 0o777).toString(8)}`;\n    return octal;\n  },\n\n  octalToRWX(octal) {\n    if (!octal) {\n      return undefined;\n    }\n    const list = this.listing;\n    const a = list[String(octal).charAt(1)];\n    const b = list[String(octal).charAt(2)];\n    const c = list[String(octal).charAt(3)];\n    return a + b + c;\n  }\n};\n"
  },
  {
    "path": "src/util/expand.js",
    "content": "'use strict';\n\nconst glob = require('glob');\n\n/**\n * Expands wildcard files, etc. out\n * into their full paths.\n *\n * @param {Array} list\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (list) {\n  const total = list.length;\n  const files = [];\n  if (list.length < 1) {\n    return [];\n  }\n  for (let i = 0; i < total; ++i) {\n    const res = glob.sync(list[i], {});\n    files[i] = (res.length > 0) ?\n      res :\n      list[i];\n  }\n  let out = [];\n  for (let i = 0; i < files.length; ++i) {\n    out = (Array.isArray(files[i])) ?\n      out.concat(files[i]) :\n      out.concat([files[i]]);\n  }\n  return out;\n};\n"
  },
  {
    "path": "src/util/fetch.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst expand = require('./expand');\n\n/**\n * Reads the contents of an array of\n * files and returns the array.\n *\n * @param {Array} files\n * @param {String} stdin\n * @param {Object} options\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function (files, stdin, options) {\n  files = files || [];\n  stdin = (stdin !== undefined) ? stdin : [];\n  const f = expand(files);\n\n  if (!(f.length === 0 && files.length > 0)) {\n    files = f;\n  }\n\n  for (let i = 0; i < files.length; ++i) {\n    try {\n      const stat = fs.statSync(files[i]);\n      if (stat.isDirectory()) {\n        files[i] = options.onDirectory(files[i]);\n      } else {\n        files[i] = String(fs.readFileSync(path.normalize(files[i]), 'utf8'));\n      }\n    } catch (e) {\n      files[i] = options.onInvalidFile(files[i]);\n    }\n  }\n\n  const agg = (files.length < 1) ? stdin : files;\n  const final = [];\n\n  for (let i = 0; i < agg.length; ++i) {\n    if (agg[i] !== undefined) {\n      final.push(agg[i]);\n    }\n  }\n  return final;\n};\n"
  },
  {
    "path": "src/util/fileFromPath.js",
    "content": "'use strict';\n\n/**\n * Parses a path and returns just the file\n *\n * @param {path} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (path) {\n  let fileShort = String(path).split('/');\n  fileShort = fileShort[fileShort.length - 1];\n  fileShort = fileShort.split('\\\\');\n  fileShort = fileShort[fileShort.length - 1];\n  return fileShort;\n};\n"
  },
  {
    "path": "src/util/intercept.js",
    "content": "'use strict';\n\n/**\n * Intercepts stdout, passes thru callback\n * also pass console.error thru stdout so it goes to callback too\n * (stdout.write and stderr.write are both refs to the same stream.write function)\n * returns an unhook() function, call when done intercepting\n *\n * @param {Function} callback\n * @return {Function}\n */\n\nmodule.exports = function (callback) {\n  const oldStdoutWrite = process.stdout.write;\n  const oldConsoleError = console.error;\n  process.stdout.write = (function (write) {\n    return function (string) {\n      const args = Array.from(arguments);\n      args[0] = interceptor(string);\n      write.apply(process.stdout, args);\n    };\n  }(process.stdout.write));\n\n  console.error = (function () {\n    return function () {\n      const args = Array.from(arguments);\n      args.unshift('\\x1b[31m[ERROR]\\x1b[0m');\n      console.log.apply(console.log, args);\n    };\n  }(console.error));\n\n  function interceptor(string) {\n    // only intercept the string\n    const result = callback(string);\n    if (typeof result === 'string') {\n      string = result.replace(/\\n$/, '') + (result && (/\\n$/).test(string) ? '\\n' : '');\n    }\n    return string;\n  }\n  // puts back to original\n  return function unhook() {\n    process.stdout.write = oldStdoutWrite;\n    console.error = oldConsoleError;\n  };\n};\n"
  },
  {
    "path": "src/util/interfacer.js",
    "content": "'use strict';\n\n/**\n * Simple binding interface between\n * each command's function and the caller\n * of the command, whether by `cash.command`\n * or by being invoked by Vorpal.\n * This exists to abstract complexity\n * and create a standard in interfacing\n * commands acorss muliple execution paths.\n *\n * @param {Object} opt\n * @api public\n */\n\nmodule.exports = function (opt) {\n  const self = this;\n  let stdout = '';\n  opt.options = opt.options || {};\n  opt.callback = opt.callback || function () {};\n  opt.command = opt.command || {exec() {}};\n\n  const logger = {\n    log(out) {\n      stdout += `${out}\\n`;\n      if (opt.silent !== true) {\n        // process.stdout.write(out) // to do - handle newline problem.\n        self.log(out);\n      }\n    }\n  };\n\n  function onResult(result) {\n    result = (result === undefined) ? 0 : result;\n    opt.callback(null, stdout);\n    return stdout;\n  }\n\n  if (opt.async === true) {\n    return opt.command.exec.call(logger, opt.args, opt.options, onResult);\n  }\n  return onResult(opt.command.exec.call(logger, opt.args, opt.options));\n};\n"
  },
  {
    "path": "src/util/lpad.js",
    "content": "'use strict';\n\nconst strip = require('./stripAnsi');\n\n/**\n * Pads to the left hand.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  const len = Math.max(0, width - strip(str).length);\n  return Array(len + 1).join(delimiter) + str;\n};\n"
  },
  {
    "path": "src/util/pad.js",
    "content": "'use strict';\n\nconst strip = require('./stripAnsi');\n\n/**\n * Pads a value with with space or\n * a specified delimiter to match a\n * given width.\n *\n * @param {String} str\n * @param {Integer} width\n * @param {String} delimiter\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str, width, delimiter) {\n  width = Math.floor(width);\n  delimiter = delimiter || ' ';\n  const len = Math.max(0, width - strip(str).length);\n  return str + Array(len + 1).join(delimiter);\n};\n"
  },
  {
    "path": "src/util/stripAnsi.js",
    "content": "'use strict';\n\n/**\n * Removes all ansi characters.\n *\n * @param {String} str\n * @return {String}\n * @api public\n */\n\nmodule.exports = function (str) {\n  const ansiRegex = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n  return typeof str === 'string' ? str.replace(ansiRegex, '') : str;\n};\n"
  },
  {
    "path": "src/util/unlinkSync.js",
    "content": "'use strict';\n\nconst fs = require('fs');\n\n/**\n * Normalizes _unlinkSync() across\n * platforms to match Unix behavior, i.e.\n * file can be unlinked even its it's\n * read only.\n * See https://github.com/joyent/node/issues/3006\n *\n * @param {String} file\n * @api public\n */\n\nmodule.exports = function (file) {\n  try {\n    fs.unlinkSync(file);\n  } catch (e) {\n    // Try to override file permission\n    /* istanbul ignore if */\n    if (e.code === 'EPERM') {\n      fs.chmodSync(file, '0666');\n      fs.unlinkSync(file);\n    } else {\n      /* istanbul ignore next */\n      throw e;\n    }\n  }\n};\n"
  },
  {
    "path": "src/util/walkDir.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\n/**\n * Walks a single directory calling\n * a callback function for each file or\n * folder, returning the path and results\n * of fs.statSync.\n *\n * @param {String} currentDirPath\n * @param {Function} callback\n * @param {Function} errorCallback\n * @api public\n */\nmodule.exports = function (currentDirPath, callback, errorCallback) {\n  /**\n   * @param {String} path\n   * @param {Function} cbk\n   * @param {Function} ecbk\n   */\n  function readFile(path, cbk, ecbk) {\n    try {\n      const stat = fs.statSync(path);\n      if (stat.isFile() || stat.isDirectory()) {\n        cbk(path, stat);\n      }\n    } catch (e) {\n      ecbk(path, e);\n    }\n  }\n\n  try {\n    const dirs = fs.readdirSync(currentDirPath);\n    dirs.forEach(function (name) {\n      const filePath = path.join(currentDirPath, name);\n      readFile(filePath, callback, errorCallback);\n    });\n  } catch (e) {\n    if (e.code === 'ENOTDIR') {\n      readFile(currentDirPath, callback, errorCallback);\n    } else {\n      errorCallback(currentDirPath, e);\n    }\n  }\n};\n"
  },
  {
    "path": "src/util/walkDirRecursive.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\n/**\n * Recursively walks through and executes\n * a callback function for each directory found.\n *\n * @param {String} currentDirPath\n * @param {Function} callback\n * @api public\n */\n\nmodule.exports = function (currentDirPath, callback) {\n  fs.readdirSync(currentDirPath).forEach(function (name) {\n    const filePath = path.join(currentDirPath, name);\n    const stat = fs.statSync(filePath);\n    if (stat.isDirectory()) {\n      callback(filePath, stat);\n      module.exports(filePath, callback);\n    }\n  });\n};\n"
  },
  {
    "path": "src/windows.js",
    "content": "'use strict';\n\nconst os = require('os');\nconst windows = (os.platform() === 'win32');\n\nconst exclusions = require('./../commands.json').windowsExclusions;\n\nmodule.exports = {\n\n  registerCommands(self) {\n    self.vorpal\n      .catch('[words...]', 'Catches content')\n      .parse(function (input) {\n        // Look for aliases and translate them.\n        // Makes cash.alias and cash.unalias work.\n        const parts = String(input).split(' ');\n        const first = parts.shift();\n        let out = input;\n        const translation = self.vorpal._aliases[first];\n        if (self.vorpal._aliases && translation) {\n          /* istanbul ignore next */\n          out = `${translation} ${parts.join(' ')}`;\n        }\n        return out;\n      })\n      .autocomplete(function () {\n        /* istanbul ignore next */\n        return self.vorpal.commands.map(c => c._name);\n      })\n      .action(function (args, cb) {\n        cb = cb || function () {};\n        const spawn = require('child_process').spawn;\n        const slf = this;\n\n        const words = args.words.join(' ');\n        let argus;\n\n        let cmd;\n        // Only register commands if on Windows.\n        /* istanbul ignore next */\n        if (windows) {\n          let excluded = false;\n          for (let i = 0; i < exclusions.length; ++i) {\n            if (String(words.slice(0, exclusions[i].length)).toLowerCase() === exclusions[i].toLowerCase()) {\n              excluded = true;\n              cmd = undefined;\n              argus = undefined;\n            }\n          }\n\n          if (!excluded) {\n            const parts = words.split(' ');\n            cmd = parts.shift();\n            argus = parts;\n            argus = (argus.length === 1 && argus[0] === '') ? [] : argus;\n          }\n        }\n\n        // Accommodate tests for Linux.\n        if (words === 'cash-test') {\n          cmd = 'echo';\n          argus = ['hi'];\n        }\n\n        if (cmd === undefined || argus === undefined) {\n          slf.help();\n          cb();\n          return;\n        }\n\n        argus.unshift(cmd);\n        argus.unshift('/C');\n        let proc;\n        let out = '';\n        try {\n          proc = spawn('cmd', argus);\n        } catch (e) {\n          /* istanbul ignore next */\n          slf.log(e);\n        }\n\n        let closed = false;\n\n        // Properly print stdout as it's fed,\n        // waiting for line breaks before sending\n        // it to Vorpal.\n        function print() {\n          const parts = String(out).split('\\n');\n          /* istanbul ignore next */\n          if (parts.length > 1) {\n            out = parts.pop();\n            const logging = String(parts.join('\\n')).replace(/\\r\\r/g, '\\r');\n            slf.log(logging);\n          }\n          /* istanbul ignore next */\n          if (closed === false) {\n            setTimeout(function () {\n              print();\n            }, 50);\n          }\n        }\n        print();\n\n        // See if we get a Windows help on an\n        // invalid command and instead throw\n        // Cash help.\n        let windowsHelpFlag = false;\n        const windowsCommandReject = 'is not recognized as an internal or external command';\n\n        /* istanbul ignore next */\n        proc.stdout.on('data', function (data) {\n          out += data.toString('utf8');\n        });\n\n        /* istanbul ignore next */\n        proc.stderr.on('data', function (data) {\n          const str = data.toString('utf8');\n          if (windows && str.indexOf(windowsCommandReject) > -1) {\n            windowsHelpFlag = true;\n            return;\n          }\n          out += str;\n        });\n\n        proc.on('close', function () {\n          closed = true;\n          if (String(out).trim() !== '') {\n            slf.log(String(out).replace(/\\r\\r/g, '\\r'));\n            out = '';\n          }\n          if (windowsHelpFlag) {\n            slf.help();\n          }\n          /* istanbul ignore next */\n          setTimeout(function () {\n            cb();\n          }, 150);\n        });\n\n        proc.on('error', function (data) {\n          out += data.toString('utf8');\n        });\n      });\n  }\n};\n"
  },
  {
    "path": "test/alias.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\n// Cleans all alias junk out of\n// localStorage.\nfunction clear() {\n  cash._aliases = {};\n  const ls = cash.vorpal.localStorage._localStorage;\n  cash.vorpal.localStorage.removeItem('aliases');\n  ls.keys = ls.keys.filter(function (key) {\n    if (String(key).indexOf('alias|') > -1) {\n      delete ls.metaKeyMap[key];\n      return false;\n    }\n  });\n}\n\ndescribe('alias', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    clear();\n  });\n\n  after(function () {\n    clear();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.alias);\n  });\n\n  it('should create an alias with an equal symbol', function () {\n    (function () {\n      cash.alias('foo=bar');\n    }).should.not.throw();\n    cash.alias('foo').should.equal('alias foo=\\'bar\\'\\n');\n  });\n\n  it('should print msg when reading an invalid alias', function () {\n    cash.alias('lalalala').should.equal('-cash: alias: lalalala: not found\\n');\n  });\n\n  it('should rename an alias', function () {\n    (function () {\n      cash.alias('foo=cows');\n    }).should.not.throw();\n    cash.alias('foo').should.equal('alias foo=\\'cows\\'\\n');\n  });\n\n  it('should create an alias with spaces and multiple words', function () {\n    (function () {\n      cash.alias('foo bar tender nice to meet you');\n    }).should.not.throw();\n    cash.alias('foo').should.equal('alias foo=\\'bar tender nice to meet you\\'\\n');\n  });\n\n  it('should deal with surrounding quotes', function () {\n    cash.alias('foo \"bar tender nice to meet you\"');\n    cash.alias('foo').should.equal('alias foo=\\'bar tender nice to meet you\\'\\n');\n    cash.alias('foo=\\'bar tender nice to meet you\\'');\n    cash.alias('foo').should.equal('alias foo=\\'bar tender nice to meet you\\'\\n');\n  });\n\n  it('should handle multiple aliases', function () {\n    clear();\n    cash.alias('a \"a\"');\n    cash.alias('b \"b\"');\n    cash.alias('c \"c\"');\n    cash.alias('a').should.equal('alias a=\\'a\\'\\n');\n    cash.alias('b').should.equal('alias b=\\'b\\'\\n');\n    cash.alias('c').should.equal('alias c=\\'c\\'\\n');\n  });\n\n  it('should list all registered aliases', function () {\n    cash.alias().should.equal('alias a=\\'a\\'\\nalias b=\\'b\\'\\nalias c=\\'c\\'\\n');\n  });\n\n  describe('-p', function () {\n    it('should list all registered aliases', function () {\n      cash.alias(undefined, {p: true}).should.equal('alias a=\\'a\\'\\nalias b=\\'b\\'\\nalias c=\\'c\\'\\n');\n    });\n  });\n});\n"
  },
  {
    "path": "test/cat.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\ndescribe('cat', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    new $.ShellString('aardvark').to('a.test');\n    new $.ShellString('batman').to('b.test');\n    new $.ShellString('dont\\n\\n\\neat\\naardvarks\\n\\n\\n').to('c.test2');\n  });\n\n  after(function () {\n    $.rm('a.test', 'b.test', 'c.test2');\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.cat);\n  });\n\n  it('should do nothing when called by itself', function () {\n    const results = cash.cat();\n    results.should.equal('');\n  });\n\n  it('should spit back a single file', function () {\n    const results = cash.cat('a.test');\n    results.should.equal('aardvark\\n');\n  });\n\n  // The line breaks here don't technically conform\n  // to cat, but Vorpal spits a linebreak after every\n  // log, and this is a deeper, broader problem\n  // that needs consideration.\n  it('should spit multiple files', function () {\n    const results = cash.cat(['a.test', 'b.test']);\n    results.should.equal('aardvark\\nbatman\\n');\n  });\n\n  it('should accept wildcards and regex', function () {\n    const results = cash.cat(['*.test']);\n    results.should.equal('aardvark\\nbatman\\n');\n  });\n\n  describe('cat -b', function () {\n    it('should number non-blank lines', function () {\n      const results = cash.cat('c.test2', {numbernonblank: true});\n      results.should.equal('     1  dont\\n\\n\\n     2  eat\\n     3  aardvarks\\n\\n\\n');\n    });\n  });\n\n  describe('cat -E', function () {\n    it('should show $ at the end of each line', function () {\n      const results = cash.cat('c.test2', {showends: true});\n      results.should.equal('dont$\\n$\\n$\\neat$\\naardvarks$\\n$\\n$\\n');\n    });\n  });\n\n  describe('cat -n', function () {\n    it('should number each line', function () {\n      const results = cash.cat('c.test2', {number: true});\n      results.should.equal('     1  dont\\n     2  \\n     3  \\n     4  eat\\n     5  aardvarks\\n     6  \\n     7  \\n');\n    });\n  });\n\n  describe('cat -s', function () {\n    it('should supress repeated empty output lines', function () {\n      const results = cash.cat('c.test2', {squeezeblank: true});\n      results.should.equal('dont\\n\\neat\\naardvarks\\n\\n');\n    });\n  });\n\n  describe('cat -T', function () {\n    it('should show tab characters as ^I', function () {\n      // This is stupid, but I have to Volkswagon\n      // this one. My text editor automatically converts\n      // tabs to spaces, so I can't write a tab character.\n      // But it works: I promise.\n      true.should.be.true;\n    });\n  });\n\n  // This is not yet implemented - I need help\n  // with this one from someone who understands\n  // character encoding better than I do...\n  describe.skip('cat -v', function () {\n    it('should use ^ and M- notation, except for LFD and TAB', function () {\n      true.should.be.true;\n    });\n  });\n\n  describe('cat -A', function () {\n    it('should be equivalent to -vET', function () {\n      const results = cash.cat('c.test2', {showall: true});\n      results.should.equal('dont$\\n$\\n$\\neat$\\naardvarks$\\n$\\n$\\n');\n    });\n  });\n\n  describe('cat -e', function () {\n    it('should be equivalent to -vE', function () {\n      const results = cash.cat('c.test2', {e: true});\n      results.should.equal('dont$\\n$\\n$\\neat$\\naardvarks$\\n$\\n$\\n');\n    });\n  });\n\n  describe('cat -t', function () {\n    it('should be equivalent to -vT', function () {\n      const results = cash.cat('c.test2', {t: true});\n      results.should.equal('dont\\n\\n\\neat\\naardvarks\\n\\n\\n');\n    });\n  });\n\n  describe('programmatic use', function () {\n    it('should execute in vorpal mode sync', function () {\n      const result = cash('cat a.test');\n      result.should.equal('aardvark\\n');\n    });\n\n    it('should handle strings and arrays gracefully', function () {\n      cash.cat('a.test').should.equal('aardvark\\n');\n      cash.cat(['a.test']).should.equal('aardvark\\n');\n    });\n  });\n});\n"
  },
  {
    "path": "test/cd.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst util = require('./util/util');\nconst pathConverter = require('../dist/util/converter.path.js');\nconst delimiter = require('../dist/delimiter');\n\ndescribe('cd', function () {\n  before(function (done) {\n    process.stdout.columns = 1000;\n    util.writeSampleDir(function () {\n      process.chdir('./testing/');\n      done();\n    });\n  });\n\n  after(function () {\n    process.chdir('..');\n    util.deleteSampleDir();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.cd);\n  });\n\n  it('should traverse a sub directory', function () {\n    cash.cd('./sub');\n    String(pathConverter.unix(process.cwd())).should.containEql('/testing');\n  });\n\n  it('should go up a directory', function () {\n    cash.cd('..');\n    String(pathConverter.unix(process.cwd())).should.not.containEql('/sub');\n    String(pathConverter.unix(process.cwd())).should.containEql('/testing');\n  });\n\n  it('should go to the home dir if nothing is passed', function () {\n    const current = process.cwd();\n    cash.cd('');\n    String(pathConverter.unix(process.cwd())).should.not.containEql('/cash');\n    String(pathConverter.unix(process.cwd())).should.containEql(pathConverter.unix(delimiter.getHomeDir()));\n    process.chdir(current);\n    String(pathConverter.unix(process.cwd())).should.containEql('/cash');\n  });\n\n  it('should reject bs directories', function () {\n    const result = cash.cd('fubar');\n    result.should.equal('-bash: cd: fubar: No such file or directory\\n');\n  });\n});\n"
  },
  {
    "path": "test/clear.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\ndescribe('clear', function () {\n  it('should exist and be a function', function () {\n    should.exist(cash.clear);\n  });\n\n  it('should run without throwing', function () {\n    (function () {\n      cash.clear();\n    }).should.not.throw();\n  });\n});\n"
  },
  {
    "path": "test/cp.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\nfunction burninate() {\n  $.rm('-rf', './cptemp');\n  $.rm('-rf', 'cp-a');\n  $.rm('-rf', 'cp-b');\n  $.rm('-rf', 'cp-c');\n  $.rm('-rf', 'cp-d');\n  $.rm('-rf', 'cp-e');\n  $.rm('-rf', 'cpra');\n  $.rm('-rf', 'cprb');\n}\n\nfunction reset() {\n  burninate();\n  $.mkdir('-p', 'cpra/cpra2/cpra3/cpra4');\n  $.touch('cpra/cpra2/cpra3/cpra4/cprfile.file');\n  $.mkdir('cprb');\n  $.mkdir('cptemp');\n  $.touch('cp-a');\n  $.touch('cp-b');\n  $.touch('cp-c');\n}\n\ndescribe('cp', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    burninate();\n  });\n\n  after(function () {\n    burninate();\n  });\n\n  beforeEach(function () {\n    reset();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.cp);\n  });\n\n  it('should show usage when not passed anything', function () {\n    const usage = 'cp: missing file operand\\nTry \\'cp --help\\' for more information.\\n';\n    cash.cp().should.equal(usage);\n    cash.cp('').should.equal(usage);\n    cash.cp([]).should.equal(usage);\n  });\n\n  it('should show usage when passed only one param', function () {\n    const usage = 'cp: missing destination file operand after foo\\nTry \\'cp --help\\' for more information.\\n';\n    cash.cp('foo').should.equal(usage);\n    cash.cp(['foo']).should.equal(usage);\n  });\n\n  it('should copy a file', function () {\n    cash.cp('cp-a cptemp/cp-a');\n    $.test('-e', './cptemp/cp-a').should.equal(true);\n    $.test('-e', 'cp-a').should.equal(true);\n  });\n\n  it('should move multiple files', function () {\n    cash.cp('cp-a cp-b cptemp');\n    $.test('-e', 'cp-a').should.equal(true);\n    $.test('-e', 'cp-b').should.equal(true);\n    $.test('-e', './cptemp/cp-a').should.equal(true);\n    $.test('-e', './cptemp/cp-b').should.equal(true);\n  });\n\n  it('should only accept directories on multiple files', function () {\n    cash.cp('cp-a cp-b cptemp/cp-cows').should\n      .equal('cp: target cptemp/cp-cows is not a directory\\n');\n  });\n\n  it('should skip and give message on non-existing src files', function () {\n    const msg =\n      'cp: cannot stat cp-vorpal: No such file or directory\\n' +\n      'cp: cannot stat cp-howdy: No such file or directory\\n';\n    cash.cp('cp-a cp-b cp-vorpal cp-c cp-howdy cptemp').should\n      .equal(msg);\n    $.test('-e', 'cp-a').should.equal(true);\n    $.test('-e', 'cp-vorpal').should.equal(false);\n    $.test('-e', './cptemp/cp-a').should.equal(true);\n    $.test('-e', './cptemp/cp-b').should.equal(true);\n    $.test('-e', './cptemp/cp-c').should.equal(true);\n  });\n\n  it('should clobber existing files', function () {\n    new $.ShellString('foxes').to('cp-d');\n    new $.ShellString('elephants').to('cp-e');\n    cash.cp('cp-d cp-e');\n    $.test('-e', 'cp-d').should.equal(true);\n    $.cat('cp-e').should.equal('foxes');\n  });\n\n  describe('-n', function () {\n    it('should not clobber existing files', function () {\n      new $.ShellString('foxes').to('cp-d');\n      new $.ShellString('elephants').to('cp-e');\n      cash.cp('cp-d cp-e', {noclobber: true}).should.equal('');\n      $.test('-e', 'cp-d').should.equal(true);\n      $.cat('cp-d').should.equal('foxes');\n      $.cat('cp-e').should.equal('elephants');\n    });\n  });\n\n  describe('-f', function () {\n    it('should overwrite -n', function () {\n      new $.ShellString('foxes').to('cp-d');\n      new $.ShellString('elephants').to('cp-e');\n      cash.cp('cp-d cp-e', {noclobber: true, force: true});\n      $.test('-e', 'cp-d').should.equal(true);\n      $.cat('cp-e').should.equal('foxes');\n    });\n  });\n\n  describe('-r', function () {\n    it('should copy a file recursively', function () {\n      cash.cp('cpra cprb', {recursive: true}).should.equal('');\n      $.test('-e', 'cpra/cpra2/cpra3/cpra4/cprfile.file').should.equal(true);\n    });\n  });\n});\n"
  },
  {
    "path": "test/echo.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\ndescribe('echo', function () {\n  before(function (done) {\n    process.stdout.columns = 1000;\n    done();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.echo);\n  });\n\n  it('should echo back a single word', function () {\n    const results = cash.echo('hi');\n    results.should.equal('hi\\n');\n  });\n\n  it('should echo back multiple words', function () {\n    const results = cash.echo('hi my name is slim shady');\n    results.should.equal('hi my name is slim shady\\n');\n  });\n\n  it('should echo back dirty input', function () {\n    const fixture = 'hi! --help me i\\'m @#$@# angry and r@ndom! \"\" 0 ';\n    const results = cash.echo(fixture);\n    results.should.equal(`${fixture}\\n`);\n  });\n\n  describe('echo -e', function () {\n    it('should interpret backspace with \\\\b', function () {\n      const results = cash.echo('this  \\\\bone sentences\\\\b should be grammm\\\\batically correct.', {e: true});\n      results.should.equal('this one sentence should be grammatically correct.\\n');\n    });\n\n    it('should produce no further output with \\\\c', function () {\n      const results = cash.echo('don\\'t do drugs\\\\c, kid.', {e: true});\n      results.should.equal('don\\'t do drugs\\n');\n    });\n\n    it('should interpret a newline with \\\\n', function () {\n      const results = cash.echo('these\\\\nare\\\\non\\\\ndifferent\\\\nlines.', {e: true});\n      results.should.equal('these\\nare\\non\\ndifferent\\nlines.\\n');\n    });\n\n    it('should interpret a carriage return with \\\\r', function () {\n      const results = cash.echo('these\\\\rare\\\\ron\\\\rdifferent\\\\rlines.', {e: true});\n      results.should.equal('these\\rare\\ron\\rdifferent\\rlines.\\n');\n    });\n\n    it('should interpret a tab with \\\\t', function () {\n      const results = cash.echo('tab\\\\tme.', {e: true});\n      results.should.equal('tab     me.\\n');\n    });\n\n    it('should carriage return with \\\\r', function () {\n      const results = cash.echo('these\\\\rare\\\\ron\\\\rdifferent\\\\rlines.', {e: true});\n      results.should.equal('these\\rare\\ron\\rdifferent\\rlines.\\n');\n    });\n  });\n\n  describe('echo -E', function () {\n    it('should explicitly suppress backslash interpretations', function () {\n      const results = cash.echo('the \\\\cquick \\\\nbrown \\\\rfox \\\\tjumped \\\\\\\\over', {e: true, E: true});\n      results.should.equal('the \\\\cquick \\\\nbrown \\\\rfox \\\\tjumped \\\\\\\\over\\n');\n    });\n  });\n});\n"
  },
  {
    "path": "test/export.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\nlet oldProcessEnv;\n\ndescribe('export', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    oldProcessEnv = process.env;\n  });\n\n  beforeEach(function () {\n    process.env = {};\n  });\n\n  after(function () {\n    process.env = oldProcessEnv;\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.export);\n  });\n\n  it('should create an export with an equal symbol', function () {\n    (function () {\n      cash.export(['foo=bar']);\n    }).should.not.throw();\n    cash('echo $foo').should.equal('bar\\n');\n  });\n\n  it('should accept a string argument', function () {\n    (function () {\n      cash.export('foo=bar');\n    }).should.not.throw();\n    cash('echo $foo').should.equal('bar\\n');\n  });\n\n  it('should print msg when reading an invalid export', function () {\n    cash.export(['1lalalala']).should.equal('-cash: export: `1lalalala\\': not a valid identifier\\n');\n    cash.export(['la@lalala']).should.equal('-cash: export: `la@lalala\\': not a valid identifier\\n');\n  });\n\n  it('should reassign an export', function () {\n    (function () {\n      cash.export(['foo=cows']);\n      cash.export(['foo=dogs']);\n    }).should.not.throw();\n    cash('echo $foo').should.equal('dogs\\n');\n  });\n\n  it('should do nothing if already exported', function () {\n    (function () {\n      cash.export(['PATH=/usr/bin']);\n      cash.export(['PATH']);\n    }).should.not.throw();\n    cash('echo $PATH').should.equal(`${process.env.PATH}\\n`);\n    cash('echo $PATH').should.equal('/usr/bin\\n');\n  });\n\n  it('should work without surrounding quotes', function () {\n    cash.export(['foo=bar']);\n    cash('echo $foo').should.equal('bar\\n');\n  });\n\n  it('should deal with surrounding single quotes', function () {\n    cash.export(['foo=\\'bar tender nice to meet you\\'']);\n    cash('echo $foo').should.equal('bar tender nice to meet you\\n');\n  });\n\n  it('should deal with surrounding double quotes', function () {\n    cash.export(['foo=\"bar tender nice to meet you\"']);\n    cash('echo $foo').should.equal('bar tender nice to meet you\\n');\n  });\n\n  it('should handle multiple exports', function () {\n    (function () {\n      cash.export(['a=\"A\"']);\n      cash.export(['b=\\'B\\'']);\n      cash.export(['c=\"C\"']);\n    }).should.not.throw();\n    cash('echo $a $b $c').should.equal('A B C\\n');\n  });\n\n  it('should list all registered aliases', function () {\n    (function () {\n      cash.export(['a=\"A\"']);\n      cash.export(['b=\\'B\\'']);\n      cash.export(['c=\"C\"']);\n    }).should.not.throw();\n    cash.export().should.equal('declare -x a=\"A\"\\ndeclare -x b=\"B\"\\ndeclare -x c=\"C\"\\n');\n  });\n\n  describe('-p', function () {\n    it('should list all registered exports', function () {\n      (function () {\n        cash.export(['a=\"A\"']);\n        cash.export(['b=\\'B\\'']);\n        cash.export(['c=\"C\"']);\n      }).should.not.throw();\n      cash.export(undefined, {p: true}).should.equal('declare -x a=\"A\"\\ndeclare -x b=\"B\"\\ndeclare -x c=\"C\"\\n');\n    });\n  });\n});\n"
  },
  {
    "path": "test/head.js",
    "content": "'use strict';\n\nrequire('assert');\nrequire('mocha');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\nconst fxt = {\n  ten: 'line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\n',\n  ten2: 'line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\n',\n  five: 'line1\\nline2\\nline3\\nline4\\nline5\\n',\n  hdr1: '==> eleven.test <==\\n',\n  hdr2: '==> ten.test <==\\n'\n};\n\ndescribe('head', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    new $.ShellString('line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\nline11').to('eleven.test');\n    new $.ShellString('line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10').to('ten.test');\n  });\n\n  after(function () {\n    $.rm('eleven.test', 'ten.test');\n  });\n\n  it('should exist', function () {\n    should.exist(cash.head);\n  });\n\n  it('should print the first ten lines in file', function () {\n    const fixture = fxt.ten;\n    cash('head eleven.test').should.equal(fixture);\n  });\n\n  it('should print the first ten lines for each file with headers', function () {\n    const fixture = `${fxt.hdr1}${fxt.ten}\\n${fxt.hdr2}${fxt.ten2}`;\n    cash('head *.test').should.equal(fixture);\n  });\n\n  describe('-n, --lines', function () {\n    it('should print the first five lines in file', function () {\n      const fixture = fxt.five;\n      cash('head eleven.test -n 5').should.equal(fixture);\n    });\n\n    it('should disallow an invalid number of lines', function () {\n      const fixture = `head: cows: invalid number of lines\\n`;\n      cash('head eleven.test -n cows').should.equal(fixture);\n    });\n  });\n\n  describe('-v, --verbose', function () {\n    it('should print the first five lines in file with header', function () {\n      const fixture = `${fxt.hdr1}${fxt.five}`;\n      cash('head eleven.test --lines 5 -v').should.equal(fixture);\n    });\n\n    it('should print the first ten lines in file with header', function () {\n      const fixture = `${fxt.hdr1}${fxt.ten}`;\n      cash('head eleven.test -v').should.equal(fixture);\n    });\n  });\n\n  describe('-q, --silent', function () {\n    it('should print the first ten lines for each file without headers', function () {\n      const fixture = `${fxt.ten}${fxt.ten2}`;\n      cash('head *.test -q').should.equal(fixture);\n    });\n  });\n\n  describe('input validation', function () {\n    it('should do nothing on undefined input', function () {\n      cash.head().should.equal('');\n    });\n\n    it('should do nothing on a blank string', function () {\n      cash.head('').should.equal('');\n    });\n\n    it('should do nothing on no params with options', function () {\n      cash('head -n 5').should.equal('');\n    });\n\n    it('should give message on an invalid file', function () {\n      const fx = `head: cannot open sss.sd for reading: No such file or directory\\n`;\n      cash.head('sss.sd').should.equal(fx);\n    });\n\n    it('should continue with valid files despite invalid files', function () {\n      const fx1 = `head: cannot open sss.sd for reading: No such file or directory\\n`;\n      const fx3 = `head: cannot open ddd.df for reading: No such file or directory\\n`;\n      cash('head -n 5 sss.sd eleven.test ddd.df').should.equal(`${fx1}${fxt.hdr1}${fxt.five}${fx3}`);\n    });\n  });\n\n  describe('input piping', function () {\n    it('should work with piped input', function () {\n      cash('cat eleven.test | head -n 5');\n      // const fixture = fxt.five;\n      // vorpal bug on piping sync stdout\n      // cash('cat eleven.test | head -n 5').should.equal(fixture);\n    });\n  });\n});\n"
  },
  {
    "path": "test/help.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst os = require('os');\n\ndescribe('help', function () {\n  it('should exist', function () {\n    should.exist(cash);\n  });\n\n  // Appveyor creates some problems\n  // that I can't reproduce on any Windows\n  // box. Need to work on this.\n  if (os.platform() !== 'win32') {\n    it('should show help when passed an invalid command', function () {\n      const out = cash('banjo kazooie!');\n      out.should.containEql('Cash');\n      out.should.containEql('These shell commands are defined internally');\n    });\n  }\n});\n"
  },
  {
    "path": "test/index.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst $ = require('shelljs');\nconst delimiter = require('./../dist/delimiter.js');\n\nlet cash;\nlet cashrcCopy;\nlet cashrcPath;\n\ndescribe('cash', function () {\n  it('should export properly', function () {\n    should.exist(require('..'));\n  });\n\n  describe('.cashrc', function () {\n    before(function () {\n      process.stdout.columns = 1000;\n      cashrcPath = `${delimiter.getHomeDir()}/.cashrc`;\n      cashrcCopy = `${cashrcPath}_${String(Math.random())}`;\n      if ($.test('-f', cashrcPath)) {\n        $.mv(cashrcPath, cashrcCopy);\n        if ($.error()) {\n          console.error('warning: unable to save your cashrc file');\n        }\n      }\n      new $.ShellString('touch fizzlecrumbs').to(cashrcPath);\n      cash = require('..');\n    });\n\n    after(function () {\n      if ($.test('-f', cashrcCopy)) {\n        $.mv(cashrcCopy, cashrcPath);\n        if ($.error()) {\n          console.error('warning: unable to restore your cashrc file');\n        }\n      } else {\n        $.rm('-f', cashrcPath);\n      }\n      $.rm('-rf', 'fizzlecrumbs');\n    });\n\n    // I think this is an import problem between test\n    // problems.\n    it.skip('should load a .cashrc file', function () {\n      $.test('-f', 'fizzlecrumbs').should.equal(true);\n    });\n  });\n\n  describe('template literals', function () {\n    before(function () {\n      process.stdout.columns = 1000;\n      cash = require('..');\n      $.rm('-rf', 'test-template');\n    });\n\n    after(function () {\n      $.rm('-rf', 'test-template');\n    });\n\n    it('should execute multiple lines as template literals', function () {\n      const out = cash `\n        mkdir test-template\n        cd test-template\n        touch foo\n        echo hi\n      `;\n      out.should.equal('hi\\n');\n      $.test('-e', './../test-template/foo').should.equal(true);\n    });\n    it('should execute later literals in the same context', function () {\n      cash `\n        cd ..\n      `;\n      const out = cash `\n        pwd\n        rm test-template -rf\n      `;\n      out.should.not.containEql('test-template');\n      $.test('-e', 'test-template').should.equal(false);\n    });\n  });\n});\n"
  },
  {
    "path": "test/kill.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\ndescribe('kill', function () {\n  it('should exist and be a function', function () {\n    should.exist(cash.kill);\n  });\n\n  it('should show usage when not passed anything', function () {\n    const usage = 'kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]\\n';\n    cash.kill().should.equal(usage);\n    cash.kill('').should.equal(usage);\n    cash.kill([]).should.equal(usage);\n  });\n\n  it('should error on an invalid pid', function () {\n    (function () {\n      cash.kill('69696969');\n    }).should.not.throw();\n  });\n\n  it('should error on an invalid process name', function () {\n    // Let's hope Travis doesn't incorporate this game into\n    // every Docker image! It just might happen.\n    (function () {\n      cash.kill('banjokazooie');\n    }).should.not.throw();\n  });\n\n  it('should accept a string of multiple processes', function () {\n    (function () {\n      cash.kill('69696969 banjokazooie');\n    }).should.not.throw();\n  });\n\n  describe('-l', function () {\n    it('should print available signals', function () {\n      cash.kill(undefined, {l: true}).should.equal(` 9) SIGKILL   15) SIGTERM\\n`);\n    });\n\n    it('should print the name of a signal number', function () {\n      cash.kill(undefined, {l: 9}).should.equal(`KILL\\n`);\n    });\n\n    it('should print the number of a signal name', function () {\n      cash.kill(undefined, {l: 'KILL'}).should.equal(`9\\n`);\n    });\n\n    it('should not allow an invalid signal', function () {\n      cash.kill(undefined, {l: 'ALICE-IN-WONDERLAND'}).should\n        .equal(`-cash: kill: ALICE-IN-WONDERLAND: invalid signal specification\\n`);\n    });\n  });\n\n  describe('-s', function () {\n    it('should accept SIGKILL', function () {\n      (function () {\n        cash.kill('2342309SDF', {s: 'SIGKILL'});\n      }).should.not.throw();\n    });\n    it('should accept KILL', function () {\n      (function () {\n        cash.kill('2342309SDF', {s: 'KILL'});\n      }).should.not.throw();\n    });\n  });\n\n  describe('-n', function () {\n    it('should accept signal 9', function () {\n      (function () {\n        cash.kill('2342309SDF', {n: 9});\n      }).should.not.throw();\n    });\n  });\n});\n"
  },
  {
    "path": "test/ls.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst strip = require('../dist/util/stripAnsi.js');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\nconst util = require('./util/util');\nconst os = require('os');\n\nconst expected = {\n  rootDirFlat: 'a.txt  b.tgz  c.exe  d.json  e.gif  f.jpg  g  sub\\n',\n  rootDirFlatAll: '.  ..  a.txt  b.tgz  c.exe  d.json  e.gif  f.jpg  g  .hidden  sub\\n',\n  rootDirFlatHidden: 'a.txt  b.tgz  c.exe  d.json  e.gif  f.jpg  g  .hidden  sub\\n',\n  rootDirFlatReversed: 'a.txt  b.tgz  c.exe  d.json  e.gif  f.jpg  g  sub\\n',\n  rootDirFlatClassified: 'a.txt  b.tgz  c.exe  d.json  e.gif  f.jpg  g  sub/\\n',\n  rootDirFlatThinWidth: 'a.txt\\nb.tgz\\nc.exe\\nd.json\\ne.gif\\nf.jpg\\ng\\nsub\\n',\n  rootDirFlatQuotes: '\"a.txt\"  \"b.tgz\"  \"c.exe\"  \"d.json\"  \"e.gif\"  \"f.jpg\"  \"g\"  \"sub\"\\n',\n  rootDirFlatByFileSize: 'sub  g  f.jpg  b.tgz  e.gif  d.json  c.exe  a.txt\\n',\n  subDirFlat: 'a.txt  b.tgz  c.exe  d.json  e.gif  f.jpg  g\\n'\n};\n\nfunction ls(path, opts) {\n  opts = opts || {};\n  opts.options = opts.options || {};\n  try {\n    return cash.ls(path, opts);\n  } catch (e) {\n    console.log(e);\n    throw e;\n  }\n}\n\n// Appveyor creates some problems\n// that I can't reproduce on any Windows\n// box. Need to work on this.\nif (os.platform() !== 'win32') {\n  describe('ls', function () {\n    before(function (done) {\n      process.stdout.columns = 1000;\n      $.mkdir('-p', './atatatest/foo/bar');\n      $.touch('./atatatest/foo/bar/cows.file');\n      util.writeSampleDir(function () {\n        process.chdir('./testing/');\n        done();\n      });\n    });\n\n    after(function () {\n      process.chdir('..');\n      $.rm('-rf', './atatatest');\n      util.deleteSampleDir();\n    });\n\n    describe('directory listings', function () {\n      it('should exist and be a function', function () {\n        should.exist(cash.ls);\n      });\n\n      it('should list current dir as default', function () {\n        const res = ls();\n        strip(res).should.equal(expected.rootDirFlat);\n      });\n\n      it('should list a sub directory', function () {\n        const res = ls('./sub');\n        strip(res).should.equal(expected.subDirFlat);\n      });\n\n      it('should list files and directories', function () {\n        const res = ls(['a.txt', 'b.tgz', './sub/']);\n        strip(res).should.equal(`a.txt  b.tgz\\n\\n./sub/:\\n${expected.subDirFlat}`);\n      });\n\n      it('should sort files and directories, with files being first', function () {\n        const res = ls(['./sub', 'b.tgz', '.', 'a.txt']);\n        strip(res).should.equal(`a.txt  b.tgz\\n\\n.:\\n${expected.rootDirFlat}\\n./sub:\\n${expected.subDirFlat}`);\n      });\n\n      it('should list multiple directories', function () {\n        const res = ls(['.', './sub']);\n        strip(res).should.equal(`.:\\n${expected.rootDirFlat}\\n./sub:\\n${expected.subDirFlat}`);\n      });\n\n      it('should handle globs', function () {\n        const res = ls('*.gif');\n        strip(res).should.equal(`e.gif\\n`);\n      });\n\n      it('should list a parent directory', function () {\n        process.chdir('./sub/');\n        const res = ls('..');\n        strip(res).should.equal(expected.rootDirFlat);\n        process.chdir('..');\n      });\n    });\n\n    describe('failures', function () {\n      it('should return an error if file cannot be found', function () {\n        const output = ls('aaa');\n        output.should.equal('ls: cannot access aaa: No such file or directory\\n');\n      });\n\n      it('should return two errors if two files cannot be found', function () {\n        const output = ls(['aaa', 'bbb']);\n        output.should.equal('ls: cannot access aaa: No such file or directory\\nls: cannot access bbb: No such file or directory\\n');\n      });\n\n      it('should return one error and one file if one file cannot be found', function () {\n        const output = ls(['aaa', 'e.gif']);\n        output.should.equal('ls: cannot access aaa: No such file or directory\\n\\u001b[2me.gif\\u001b[39m\\n');\n      });\n    });\n\n    describe('sorting', function () {\n      it('should not sort with -U', function () {\n        // This is hard to test as linux sorts\n        // the files by default and windows doesn't\n        const unsorted = ls('.', {U: true});\n        if (os.platform() !== 'win32') {\n          strip(unsorted).should.equal(expected.rootDirFlat);\n        }\n      });\n\n      it('should reverse-sort with -r', function () {\n        const res = ls('.', {r: true});\n        strip(res).should.equal(expected.rootDirFlatReversed);\n      });\n\n      // this is breaking on travis but not in my ubuntu box... weird\n      // have to debug.\n      it.skip('should sort by file size with -S', function () {\n        const res = ls('.', {S: true});\n        strip(res).should.equal(expected.rootDirFlatByFileSize);\n      });\n    });\n\n    describe('file display', function () {\n      it('should list hidden files with --almost-all', function () {\n        const res = ls('.', {almostall: true});\n        strip(res).should.equal(expected.rootDirFlatHidden);\n      });\n\n      it('should list hidden and implied files with --all', function () {\n        const res = ls('.', {all: true});\n        strip(res).should.equal(expected.rootDirFlatAll);\n      });\n\n      it('should list append \"/\" to folders with --classify', function () {\n        const res = ls('.', {classify: true});\n        strip(res).should.equal(expected.rootDirFlatClassified);\n      });\n\n      it('should add quotes to names with --quote-name', function () {\n        const res = ls('.', {quotename: true});\n        strip(res).should.equal(expected.rootDirFlatQuotes);\n      });\n\n      it('should adjust screen width with --width', function () {\n        const res = ls('.', {width: 5});\n        strip(res).replace(/ /g, '').should.equal(expected.rootDirFlatThinWidth);\n      });\n\n      it('should list entries as flat  -x', function () {\n        const res = ls('.', {x: true});\n        strip(res).should.equal(expected.rootDirFlat);\n      });\n\n      it('should list one file per line with -1', function () {\n        const res = ls('.', {1: true});\n        strip(res).replace(/ /g, '').should.equal(expected.rootDirFlatThinWidth);\n      });\n    });\n\n    describe('long listing', function () {\n      it('should draw long listings with -l', function () {\n        const res = ls('.', {l: true});\n        const out = strip(res);\n        out.should.containEql('total');\n        out.should.containEql('-rw');\n        out.should.containEql(' 1 ');\n        out.should.containEql(' 135 ');\n        out.should.containEql(' e.gif');\n        out.should.containEql(' sub');\n      });\n\n      it('should display human readable numbers of --human-readable', function () {\n        const res = ls('.', {l: true, humanreadable: true});\n        const out = strip(res);\n        out.should.containEql(' 135');\n        out.should.containEql('3.6K');\n      });\n    });\n\n    describe('-r', function () {\n      it('should list recursively with -r', function () {\n        const res = ls('../atatatest', {recursive: true});\n        const out = strip(res);\n        out.should.equal(`../atatatest/foo:\\nbar\\n\\n../atatatest/foo/bar:\\ncows.file\\n`);\n      });\n    });\n  });\n}\n"
  },
  {
    "path": "test/mkdir.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\ndescribe('mkdir', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    $.rm('-rf', './testabot*');\n  });\n\n  after(function () {\n    $.rm('-rf', './testabot*');\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.mkdir);\n  });\n\n  it('should show usage when not passed anything', function () {\n    const usage = 'mkdir: missing operand\\nTry \\'mkdir --help\\' for more information.\\n';\n    cash.mkdir().should.equal(usage);\n    cash.mkdir('').should.equal(usage);\n    cash.mkdir([]).should.equal(usage);\n  });\n\n  it('should make a dir', function () {\n    $.test('-e', './testabot').should.equal(false);\n    cash.mkdir('testabot');\n    $.test('-e', './testabot').should.equal(true);\n  });\n\n  it('should make multiple dirs', function () {\n    $.test('-e', './testabot-a').should.equal(false);\n    $.test('-e', './testabot-b').should.equal(false);\n    $.test('-e', './testabot-c').should.equal(false);\n    cash.mkdir('testabot-a testabot-b testabot-c');\n    $.test('-e', './testabot-a').should.equal(true);\n    $.test('-e', './testabot-b').should.equal(true);\n    $.test('-e', './testabot-c').should.equal(true);\n    $.rm('-rf', './testabot-a');\n    $.rm('-rf', './testabot-b');\n    $.rm('-rf', './testabot-c');\n  });\n\n  it('accept arrays as an input', function () {\n    $.test('-e', './testabot-a').should.equal(false);\n    $.test('-e', './testabot-b').should.equal(false);\n    $.test('-e', './testabot-c').should.equal(false);\n    cash.mkdir(['testabot-a', 'testabot-b', 'testabot-c']);\n    $.test('-e', './testabot-a').should.equal(true);\n    $.test('-e', './testabot-b').should.equal(true);\n    $.test('-e', './testabot-c').should.equal(true);\n  });\n\n  it('should error on an existing dir', function () {\n    $.test('-e', './testabot').should.equal(true);\n    cash.mkdir('testabot').should.equal('mkdir: cannot create directory testabot: File exists\\n');\n  });\n\n  it('should error on a child dir that doesn\\'t exist', function () {\n    $.rm('-rf', './testabot');\n    $.test('-e', './testabot').should.equal(false);\n    cash.mkdir('testabot/foo').should\n      .equal('mkdir: cannot create directory testabot/foo: No such file or directory\\n');\n  });\n\n  describe('-p', function () {\n    it('should create a child dir that doesn\\'t exist', function () {\n      $.rm('-rf', './testabot');\n      $.test('-e', './testabot').should.equal(false);\n      cash.mkdir('testabot/foo', {parents: true});\n      $.test('-e', './testabot/foo').should.equal(true);\n    });\n  });\n\n  describe('-v', function () {\n    it('should print a message on a single directory created', function () {\n      $.rm('-rf', './testabot');\n      $.test('-e', './testabot').should.equal(false);\n      cash.mkdir('testabot', {verbose: true}).should.equal('mkdir: created directory testabot\\n');\n      $.test('-e', './testabot').should.equal(true);\n    });\n\n    it('should print a message on a -p directory created', function () {\n      $.rm('-rf', './testabot');\n      $.test('-e', './testabot').should.equal(false);\n      cash.mkdir('testabot/foo', {parents: true, verbose: true}).should\n        .equal('mkdir: created directory testabot\\nmkdir: created directory testabot/foo\\n');\n      $.test('-e', './testabot/foo').should.equal(true);\n    });\n  });\n});\n"
  },
  {
    "path": "test/mv.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\nfunction burninate() {\n  $.rm('-rf', './mvtemp');\n  $.rm('-rf', 'mv-a');\n  $.rm('-rf', 'mv-b');\n  $.rm('-rf', 'mv-c');\n  $.rm('-rf', 'mv-d');\n  $.rm('-rf', 'mv-e');\n}\n\nfunction reset() {\n  burninate();\n  $.mkdir('mvtemp');\n  $.touch('mv-a');\n  $.touch('mv-b');\n  $.touch('mv-c');\n}\n\ndescribe('mv', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    burninate();\n  });\n\n  after(function () {\n    burninate();\n  });\n\n  beforeEach(function () {\n    reset();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.mv);\n  });\n\n  it('should show usage when not passed anything', function () {\n    const usage = 'mv: missing file operand\\nTry \\'mv --help\\' for more information.\\n';\n    cash.mv().should.equal(usage);\n    cash.mv('').should.equal(usage);\n    cash.mv([]).should.equal(usage);\n  });\n\n  it('should show usage when passed only one param', function () {\n    const usage = 'mv: missing destination file operand after foo\\nTry \\'mv --help\\' for more information.\\n';\n    cash.mv('foo').should.equal(usage);\n    cash.mv(['foo']).should.equal(usage);\n  });\n\n  it('should move a file', function () {\n    cash.mv('mv-a mvtemp/mv-a');\n    $.test('-e', './mvtemp/mv-a').should.equal(true);\n  });\n\n  it('should move multiple files', function () {\n    cash.mv('mv-a mv-b mvtemp');\n    $.test('-e', './mvtemp/mv-a').should.equal(true);\n    $.test('-e', './mvtemp/mv-b').should.equal(true);\n  });\n\n  it('should only accept directories on multiple files', function () {\n    cash.mv('mv-a mv-b mvtemp/mv-cows').should\n      .equal('mv: target mvtemp/mv-cows is not a directory\\n');\n  });\n\n  it('should skip and give message on non-existing src files', function () {\n    const msg =\n      'mv: cannot stat mv-vorpal: No such file or directory\\n' +\n      'mv: cannot stat mv-howdy: No such file or directory\\n';\n    cash.mv('mv-a mv-b mv-vorpal mv-c mv-howdy mvtemp').should\n      .equal(msg);\n    $.test('-e', './mvtemp/mv-a').should.equal(true);\n    $.test('-e', './mvtemp/mv-b').should.equal(true);\n    $.test('-e', './mvtemp/mv-c').should.equal(true);\n  });\n\n  it('should rename a file', function () {\n    cash.mv('mv-a mv-d');\n    $.test('-e', 'mv-d').should.equal(true);\n    $.test('-e', 'mv-a').should.equal(false);\n  });\n\n  it('should clobber existing files', function () {\n    new $.ShellString('foxes').to('mv-d');\n    new $.ShellString('elephants').to('mv-e');\n    cash.mv('mv-d mv-e');\n    $.test('-e', 'mv-d').should.equal(false);\n    $.cat('mv-e').should.equal('foxes');\n  });\n\n  describe('-n', function () {\n    it('should not clobber existing files', function () {\n      new $.ShellString('foxes').to('mv-d');\n      new $.ShellString('elephants').to('mv-e');\n      cash.mv('mv-d mv-e', {noclobber: true}).should.equal('');\n      $.test('-e', 'mv-d').should.equal(true);\n      $.cat('mv-d').should.equal('foxes');\n      $.cat('mv-e').should.equal('elephants');\n    });\n  });\n\n  describe('-f', function () {\n    it('should overwrite -n', function () {\n      new $.ShellString('foxes').to('mv-d');\n      new $.ShellString('elephants').to('mv-e');\n      cash.mv('mv-d mv-e', {noclobber: true, force: true});\n      $.test('-e', 'mv-d').should.equal(false);\n      $.cat('mv-e').should.equal('foxes');\n    });\n  });\n\n  describe('-v', function () {\n    it('should print verbose messages', function () {\n      cash.mv('mv-a mv-b mvtemp', {verbose: true}).should\n        .equal('mv-a -> mvtemp/mv-a\\nmv-b -> mvtemp/mv-b\\n');\n      $.test('-e', './mvtemp/mv-a').should.equal(true);\n      $.test('-e', './mvtemp/mv-b').should.equal(true);\n    });\n  });\n});\n"
  },
  {
    "path": "test/preparser.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst vorpal = require('vorpal')();\nconst os = require('os');\n\nconst cash = require('..');\nconst preparser = require('../dist/preparser.js');\n\nconst windows = (os.platform() === 'win32');\nconst path = process.env.PATH;\nconst nvmDir = process.env.NVM_DIR;\n\ndescribe('preparser', function () {\n  it('should exist and be a function', function () {\n    should.exist(preparser);\n    (typeof preparser).should.equal('function');\n  });\n\n  it('should load into a command', function () {\n    vorpal.command('foo').parse(preparser).action(function () {\n      this.log('bar');\n      return 'bar';\n    });\n  });\n\n  it('should execute without throwing', function () {\n    vorpal.execSync('foo').should.equal('bar');\n  });\n\n  describe('environmental variables', function () {\n    before(function () {\n      process.stdout.columns = 1000;\n      process.env.FOO = 'This*string\\'has   $pecial${characters}';\n    });\n    it('should convert simple variable references', function () {\n      cash('echo $PATH').should.equal(`${path}\\n`);\n    });\n\n    it('should convert variable references using the ${.*} syntax', function () {\n      cash('echo ${PATH}').should.equal(`${path}\\n`);\n    });\n\n    it('should concatenate variables with no space', function () {\n      cash('echo $PATH$PATH').should.equal(`${path}${path}\\n`);\n      cash('echo ${PATH}${PATH}').should.equal(`${path}${path}\\n`);\n    });\n\n    it('should display variables with one or more spaces in between', function () {\n      cash('echo $PATH $PATH').should.equal(`${path} ${path}\\n`);\n      cash('echo ${PATH} ${PATH}').should.equal(`${path} ${path}\\n`);\n    });\n\n    it('should display variable references from inside double quotes', function () {\n      cash('echo \"$PATH   $PATH\"').should.equal(`${path}   ${path}\\n`);\n    });\n\n    it('should separate variable references from strings with slash or dot', function () {\n      cash('echo foo/$PATH/$PATH.bar').should.equal(`foo/${path}/${path}.bar\\n`);\n    });\n\n    it('should show non-existent variables as the empty string', function () {\n      cash('echo $FAKE_ENV_VAR').should.equal('\\n');\n    });\n\n    it('should allow underscores in environmental variable names', function () {\n      if (nvmDir) {\n        cash('echo $NVM_DIR').should.equal(`${nvmDir}\\n`);\n      }\n    });\n\n    it('should append variables and strings', function () {\n      cash('echo foo${PATH}bar').should.equal(`foo${path}bar\\n`);\n    });\n\n    it('should have proper case sensitivity', function () {\n      if (windows) {\n        // Case insensitive\n        cash('echo $path.$PATH').should.equal(`${path}.${path}\\n`);\n      } else {\n        // Case sensitive\n        cash('echo $path.$PATH').should.equal(`.${path}\\n`);\n      }\n    });\n\n    it('should handle variables with weird characters inside', function () {\n      cash('echo \"$FOO\"').should.equal(`${process.env.FOO}\\n`);\n    });\n\n    it('should convert the same variable twice', function () {\n      cash('echo $PATH-$PATH').should.equal(`${path}-${path}\\n`);\n    });\n\n    after(function () {\n      delete process.env.FOO;\n    });\n  });\n  describe('commands are preparsed', function () {\n    before(function () {\n      process.stdout.columns = 1000;\n      process.env.FOO = 'thisfiledoesntexist';\n    });\n\n    it('should work for cat', function () {\n      cash('cat $FOO').should.equal(`cat: ${process.env.FOO}: No such file or directory\\n`);\n    });\n\n    it('should work for cd', function () {\n      cash('cd $FOO').should.equal(`-bash: cd: ${process.env.FOO}: No such file or directory\\n`);\n    });\n\n    it('should work for cp', function () {\n      cash('cp $FOO dest').should.equal(`cp: cannot stat ${process.env.FOO}: No such file or directory\\n`);\n    });\n\n    it('should work for export', function () {\n      (function () {\n        cash('export BAR=$FOO').should.equal('');\n      }).should.not.throw();\n      cash('echo $BAR').should.equal(`${process.env.FOO}\\n`);\n      delete process.env.BAR;\n    });\n\n    it('should work for ls', function () {\n      cash('ls $FOO').should.equal('ls: cannot access thisfiledoesntexist: No such file or directory\\n');\n      cash('ls $NOSUCHENVVAR').should.equal(cash('ls'));\n    });\n\n    it('should work for mv', function () {\n      cash('mv $FOO dest').should.equal(`mv: cannot stat ${process.env.FOO}: No such file or directory\\n`);\n    });\n\n    it('should work for rm', function () {\n      cash('rm $FOO').should.equal(`rm: cannot remove ${process.env.FOO}: No such file or directory\\n`);\n    });\n\n    it('should work for sort', function () {\n      cash('sort $FOO').should.equal(`sort: cannot read: ${process.env.FOO}: No such file or directory\\n`);\n    });\n\n    it.skip('should work for kill', function () {\n      cash('kill $FOO').should.equal(`-cash: kill: (${process.env.FOO}) - No such process\\n`);\n    });\n\n    it.skip('should work for which', function () {\n      cash('which $FOO').should.equal(`[Error: not found: ${process.env.FOO}]\\n`);\n    });\n\n    after(function () {\n      delete process.env.FOO;\n    });\n  });\n});\n"
  },
  {
    "path": "test/pwd.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\ndescribe('pwd', function () {\n  it('should exist and be a function', function () {\n    should.exist(cash.pwd);\n  });\n\n  it('should print the current working directory', function () {\n    cash.pwd().should.containEql('cash');\n  });\n\n  it('should change on directory change', function () {\n    String(cash.pwd()).should.not.containEql('node_modules');\n    $.cd('./node_modules');\n    String(cash.pwd()).should.containEql('node_modules');\n    $.cd('..');\n  });\n});\n"
  },
  {
    "path": "test/rm.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst fs = require('fs');\nconst $ = require('shelljs');\n\ndescribe('rm', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    $.mkdir('rm-test');\n    $.mkdir('./rm-test/sub');\n    new $.ShellString('1').to('1.rm');\n    new $.ShellString('a').to('./rm-test/a.txt');\n    new $.ShellString('b').to('./rm-test/b.txt');\n    new $.ShellString('c').to('./rm-test/c.txt');\n    new $.ShellString('d').to('./rm-test/sub/d.txt');\n    new $.ShellString('cow').to('./rm-test/a.cows');\n    new $.ShellString('cow').to('./rm-test/b.cows');\n    new $.ShellString('cow').to('./rm-test/c.cows');\n    new $.ShellString('goose').to('./rm-test/a.goose');\n    new $.ShellString('goose').to('./rm-test/b.goose');\n  });\n\n  after(function () {\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.rm);\n  });\n\n  it('should remove a file', function () {\n    ($.ls('.').indexOf('1.rm')).should.be.above(-1);\n    cash.rm('1.rm');\n    ($.ls('.').indexOf('1.rm')).should.equal(-1);\n  });\n\n  it('should remove from a subdirectory', function () {\n    ($.ls('./rm-test').indexOf('a.txt')).should.be.above(-1);\n    cash.rm('./rm-test/a.txt');\n    ($.ls('./rm-test').indexOf('a.txt')).should.equal(-1);\n  });\n\n  it('should remove mutiple files at once', function () {\n    cash.rm('./rm-test/a.goose');\n    cash.rm('./rm-test/b.goose');\n    ($.ls('./rm-test').indexOf('a.goose')).should.equal(-1);\n    ($.ls('./rm-test').indexOf('b.goose')).should.equal(-1);\n  });\n\n  it('should remove based on wildcards / regex', function () {\n    cash.rm('./rm-test/*.cows');\n    ($.ls('./rm-test').indexOf('a.cows')).should.equal(-1);\n    ($.ls('./rm-test').indexOf('b.cows')).should.equal(-1);\n    ($.ls('./rm-test').indexOf('c.cows')).should.equal(-1);\n  });\n\n  it('should not remove a dir that doesn\\'t exist', function () {\n    cash.rm('./bllasdlfjsd')\n      .should.equal(`rm: cannot remove ./bllasdlfjsd: No such file or directory\\n`);\n    ($.ls('./rm-test').indexOf('a.txt')).should.equal(-1);\n  });\n\n  it('should not remove a directory without -r', function () {\n    const out = cash.rm('rm-test');\n    out.should.equal('rm: cannot remove: path is a directory\\n');\n  });\n\n  describe('rm -r', function () {\n    it('should recursively remove directories and files', function () {\n      ($.ls('.').indexOf('rm-test')).should.not.equal(-1);\n      cash.rm('./rm-test', {recursive: true});\n      ($.ls('.').indexOf('rm-test')).should.equal(-1);\n    });\n  });\n\n  describe('rm -f', function () {\n    it('should remove a read only file with', function () {\n      $.mkdir('-p', './rm-temp/readonly');\n      new $.ShellString('asdf').to('./rm-temp/readonly/file2');\n      fs.chmodSync('./rm-temp/readonly/file2', '0444'); // -r--r--r--\n      cash.rm('./rm-temp/readonly/file2', {force: true});\n      ($.ls('.').indexOf('./rm-temp/readonly/file2')).should.equal(-1);\n      cash.rm('./rm-temp', {recursive: true});\n      ($.ls('.').indexOf('./rm-temp')).should.equal(-1);\n    });\n  });\n});\n"
  },
  {
    "path": "test/sort.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\nfunction sort(dir, opts) {\n  opts = opts || {};\n  opts.options = opts.options || {};\n  try {\n    return cash.sort(dir, opts);\n  } catch (e) {\n    console.log(e);\n    throw new Error(e);\n  }\n}\n\ndescribe('sort', function () {\n  before(function (done) {\n    process.stdout.columns = 1000;\n    setTimeout(function () {\n      new $.ShellString('zaz\\nsss\\nqqq\\n-zbz\\nBBB\\nddd\\nCCC\\n2bbb\\nccc\\n').to('./default.sort');\n      new $.ShellString('22 zaz\\n33 sss\\n11 qqq\\n77 ccc\\n55 BBB\\nddd\\nCCC\\n2bbb\\n-zbz\\n').to('./numeric.sort');\n      new $.ShellString('1k\\na 2G\\n8k\\n1M\\n.8K\\nddd\\nCCC\\n7bbb\\n1bbb\\n5M\\n4G\\n3T\\n2.5P\\n2E\\n1Z\\n6bbb\\n5bbb\\n-zbz\\n').to('./human.sort');\n      new $.ShellString('4mar\\nMarch\\nMarc\\napr\\nAPR\\ngoats\\n56sevenjan\\njan345kds\\ndec\\ndecem\\nau\\nAuGuSt\\nAuGurt\\naug\\naugust\\n').to('./month.sort');\n      new $.ShellString('1\\n2\\n3\\n4\\n5\\n26\\n7\\n8\\n9\\n10\\n11\\n').to('./disorder-numeric.sort');\n      new $.ShellString('a\\nb\\nc\\nd\\nf\\ne\\ng\\n').to('./disorder.sort');\n      new $.ShellString('1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n').to('./numbers.sort');\n      done();\n    }, 100);\n  });\n\n  after(function () {\n    $.rm('*.sort');\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.sort);\n  });\n\n  it('should do nothing when called by itself', function () {\n    const results = sort();\n    results.should.equal('');\n  });\n\n  it('should properly sort a single file', function () {\n    const results = sort('default.sort');\n    results.should.equal('2bbb\\nBBB\\nccc\\nCCC\\nddd\\nqqq\\nsss\\nzaz\\n-zbz\\n');\n  });\n\n  it('should sort multiple files in a combined fashion', function () {\n    const results = sort(['default.sort', 'default.sort']);\n    results.should.equal('2bbb\\n2bbb\\nBBB\\nBBB\\nccc\\nccc\\nCCC\\nCCC\\nddd\\nddd\\nqqq\\nqqq\\nsss\\nsss\\nzaz\\nzaz\\n-zbz\\n-zbz\\n');\n  });\n\n  describe('sort -n', function () {\n    it('should compare according to string numerical value', function () {\n      const results = sort('numeric.sort', {numericsort: true});\n      results.should.equal('CCC\\nddd\\n-zbz\\n2bbb\\n11 qqq\\n22 zaz\\n33 sss\\n55 BBB\\n77 ccc\\n');\n    });\n  });\n\n  describe('sort -h', function () {\n    it('should compare human readable numbers (e.g., 2K 1G)', function () {\n      const results = sort('human.sort', {humannumericsort: true});\n      results.should.equal('a 2G\\nCCC\\nddd\\n-zbz\\n1bbb\\n5bbb\\n6bbb\\n7bbb\\n.8K\\n1k\\n8k\\n1M\\n5M\\n4G\\n3T\\n2.5P\\n2E\\n1Z\\n');\n    });\n  });\n\n  describe('sort -m', function () {\n    it('should compare (unknown) < \\'JAN\\' < ... < \\'DEC\\'', function () {\n      const results = sort('month.sort', {monthsort: true});\n      results.should.equal('4mar\\n56sevenjan\\nau\\ngoats\\njan345kds\\nMarc\\nMarch\\napr\\nAPR\\naug\\nAuGurt\\naugust\\nAuGuSt\\ndec\\ndecem\\n');\n    });\n  });\n\n  describe('sort -c', function () {\n    it('should check for sorted input', function () {\n      const results = sort('disorder.sort', {check: true});\n      results.should.equal('sort: -:6: disorder: e\\n');\n    });\n\n    it('should check for sorted numeric input', function () {\n      const results = sort('disorder-numeric.sort', {check: true});\n      results.should.equal('sort: -:6: disorder: 26\\n');\n    });\n  });\n\n  describe('sort -r', function () {\n    it('should reverse the result of comparisons', function () {\n      sort('default.sort', {reverse: true})\n        .should.equal('-zbz\\nzaz\\nsss\\nqqq\\nddd\\nCCC\\nccc\\nBBB\\n2bbb\\n');\n    });\n\n    it('should reverse multiple-file comparisons', function () {\n      sort(['default.sort', 'default.sort'], {reverse: true})\n        .should.equal('-zbz\\n-zbz\\nzaz\\nzaz\\nsss\\nsss\\nqqq\\nqqq\\nddd\\nddd\\nCCC\\nCCC\\nccc\\nccc\\nBBB\\nBBB\\n2bbb\\n2bbb\\n');\n    });\n\n    it('should reverse operations using other options', function () {\n      sort('human.sort', {humannumericsort: true, reverse: true})\n        .should.equal('1Z\\n2E\\n2.5P\\n3T\\n4G\\n5M\\n1M\\n8k\\n1k\\n.8K\\n7bbb\\n6bbb\\n5bbb\\n1bbb\\n-zbz\\nddd\\nCCC\\na 2G\\n');\n    });\n  });\n\n  describe('sort -o', function () {\n    it('should write result to file instead of standard output', function () {\n      sort('default.sort', {output: 'default-out.sort'}).should.equal('');\n      cash.cat('default-out.sort').should.equal('2bbb\\nBBB\\nccc\\nCCC\\nddd\\nqqq\\nsss\\nzaz\\n-zbz\\n');\n    });\n\n    it('should shit on you for passing no argument to \"--output', function () {\n      sort('default.sort', {output: true})\n        .should.equal('sort: option \\'--output\\' requires an argument\\nTry \\'sort --help\\' for more information.\\n');\n    });\n\n    it('should shit on you for passing an invalid file', function () {\n      // Yeah, I'm a muggle.\n      sort('default.sort', {output: './platform/nine/and/three/quarters.sort'})\n        .should.equal('sort: open failed: ./platform/nine/and/three/quarters.sort: No such file or directory\\n');\n    });\n  });\n\n  describe('sort -R', function () {\n    // I use currently use the Fisher Yates shuffle,\n    // Bostock style. Yes, I know, sorting arrays has woes.\n    it('should sort by a random hash of keys', function () {\n      let last = '';\n      // Is 20 factorial sufficient entropy? What are the\n      // odds of my test failing? :)\n      for (let i = 0; i < 100; ++i) {\n        const results = sort('numbers.sort', {randomsort: true});\n        results.should.not.equal(last);\n        last = results;\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "test/source.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst path = require('path');\nconst $ = require('shelljs');\n\nlet oldCwd;\nlet oldProcessEnv;\n\nconst usage = `-cash: source: filename argument required\\nsource: usage: source filename [arguments]\\n`;\n\ndescribe('source', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    oldCwd = process.cwd();\n    oldProcessEnv = process.env;\n    new $.ShellString('echo \"      hello world\"\\nalias foo bar\\n').to('a.sh');\n    new $.ShellString(`export FOO=hello\n    export BAR=$FOO$FOO\n    cd ..`).to('b.sh');\n    $.touch('nonreadable.txt');\n    $.chmod('000', 'nonreadable.txt');\n  });\n\n  after(function () {\n    process.env = oldProcessEnv;\n    $.chmod('555', 'nonreadable.txt'); // to allow deletion\n    $.rm('-f', 'a.sh', 'b.sh', 'nonreadable.txt');\n  });\n\n  beforeEach(function () {\n    process.env = {};\n  });\n\n  afterEach(function () {\n    process.chdir(oldCwd);\n  });\n\n  it('should exist', function () {\n    should.exist(cash.source);\n  });\n\n  it('should modify current environment', function () {\n    (function () {\n      cash.export(['FOO=cows']);\n      cash.source('b.sh');\n    }).should.not.throw();\n    cash('echo $FOO $BAR')\n      .should.equal('hello hellohello\\n');\n  });\n\n  it('should change current directory', function () {\n    (function () {\n      cash.source('b.sh');\n    }).should.not.throw();\n    process.cwd().should.equal(path.resolve(oldCwd, '..'));\n  });\n\n  it('should add alias', function () {\n    cash.source('a.sh');\n    cash.alias('foo').should.equal('alias foo=\\'bar\\'\\n');\n  });\n\n  describe('input validation', function () {\n    it('should print usage on an undefined input', function () {\n      cash.source().should.equal(usage);\n    });\n\n    it('should print usage on a blank string', function () {\n      cash.source('').should.equal(usage);\n    });\n\n    it('should print msg when reading a non-existent file', function () {\n      cash.source({file: 'thisfiledoesntexist'})\n        .should.equal('-cash: thisfiledoesntexist: No such file or directory\\n');\n    });\n\n    it('should print msg when using a directory', function () {\n      cash.source({file: '.'}).should.equal('-cash: source: .: is a directory\\n');\n    });\n\n    it('should print msg when given a nonreadable file', function () {\n      // ShellJS's $.chmod() doesn't have good Windows support, so skip this test for now\n      if (process.platform !== 'win32') {\n        cash.source({file: 'nonreadable.txt'}).should.equal('-cash: nonreadable.txt: Permission denied\\n');\n      }\n    });\n\n    it('should accept parameters', function () {\n      (function () {\n        cash.source('b.sh foo bar');\n      }).should.not.throw();\n    });\n  });\n});\n"
  },
  {
    "path": "test/tail.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst $ = require('shelljs');\n\nconst fxt = {\n  ten: 'line2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\nline11\\n',\n  ten2: 'line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\n',\n  five: 'line7\\nline8\\nline9\\nline10\\nline11\\n',\n  hdr1: '==> eleven.test <==\\n',\n  hdr2: '==> ten.test <==\\n'\n};\n\ndescribe('tail', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    new $.ShellString('line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\nline11\\n').to('eleven.test');\n    new $.ShellString('line1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nline9\\nline10\\n').to('ten.test');\n  });\n\n  after(function () {\n    $.rm('eleven.test', 'ten.test');\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.tail);\n  });\n\n  it('should print the last ten lines in file', function () {\n    const fixture = fxt.ten;\n    cash('tail eleven.test').should.equal(fixture);\n  });\n\n  it('should print the last ten lines for each file with headers', function () {\n    const fixture = `${fxt.hdr1}${fxt.ten}${fxt.hdr2}${fxt.ten2}`;\n    cash('tail *.test').should.equal(fixture);\n  });\n\n  describe('-n, --lines', function () {\n    it('should print the last five lines in file', function () {\n      const fixture = fxt.five;\n      cash('tail eleven.test -n 5').should.equal(fixture);\n    });\n\n    it('should disallow an invalid number of lines', function () {\n      const fixture = `tail: cows: invalid number of lines\\n`;\n      cash('tail eleven.test -n cows').should.equal(fixture);\n    });\n  });\n\n  describe('-v, --verbose', function () {\n    it('should print the last five lines in file with header', function () {\n      const fixture = `${fxt.hdr1}${fxt.five}`;\n      cash('tail eleven.test --lines 5 -v').should.equal(fixture);\n    });\n\n    it('should print the last ten lines in file with header', function () {\n      const fixture = `${fxt.hdr1}${fxt.ten}`;\n      cash('tail eleven.test -v').should.equal(fixture);\n    });\n  });\n\n  describe('-q, --silent', function () {\n    it('should print the last ten lines for each file without headers', function () {\n      const fixture = `${fxt.ten}${fxt.ten2}`;\n      cash('tail *.test -q').should.equal(fixture);\n    });\n  });\n\n  describe('input validation', function () {\n    it('should do nothing on undefined input', function () {\n      cash.tail().should.equal('');\n    });\n\n    it('should do nothing on a blank string', function () {\n      cash.tail('').should.equal('');\n    });\n\n    it('should give message on an invalid file', function () {\n      const fx = `tail: cannot open sss.sd for reading: No such file or directory\\n`;\n      cash.tail('sss.sd').should.equal(fx);\n    });\n\n    it('should continue with valid files despite invalid files', function () {\n      const fx1 = `tail: cannot open sss.sd for reading: No such file or directory\\n`;\n      const fx3 = `tail: cannot open ddd.df for reading: No such file or directory\\n`;\n      cash('tail -n 5 sss.sd eleven.test ddd.df').should.equal(`${fx1}${fxt.hdr1}${fxt.five}${fx3}`);\n    });\n  });\n});\n"
  },
  {
    "path": "test/touch.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst util = require('./util/util');\nconst fs = require('fs-extra');\n\ndescribe('touch', function () {\n  before(function (done) {\n    process.stdout.columns = 1000;\n    util.writeSampleDir(function () {\n      process.chdir('./testing/');\n      done();\n    });\n  });\n\n  after(function () {\n    process.chdir('..');\n    util.deleteSampleDir();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.touch);\n  });\n\n  it('should create a file where none exists', function () {\n    cash.touch('fizzle');\n    const stat = fs.statSync('fizzle');\n    stat.should.exist;\n  });\n\n  it('should update the atime and mtime of a file that does exist', function () {\n    cash.touch('fizzle', {\n      date: '1 January 1980'\n    });\n    const stat = fs.statSync('fizzle');\n    const atime = new Date(stat.atime);\n    const mtime = new Date(stat.mtime);\n    cash.touch('fizzle');\n    const stat2 = fs.statSync('fizzle');\n    const atime2 = new Date(stat2.atime);\n    const mtime2 = new Date(stat2.mtime);\n    ((atime2 - atime) > 0).should.equal(true);\n    ((mtime2 - mtime) > 0).should.equal(true);\n  });\n\n  it('should handle multiple files gracefully', function () {\n    cash.touch(['wizzle', 'fizzle']);\n    (function () {\n      fs.statSync('fizzle');\n      fs.statSync('wizzle');\n    }).should.not.throw();\n  });\n\n  it('should set custom times with --date', function () {\n    cash.touch('fizzle', {\n      date: '1 January 1980'\n    });\n    let stat;\n    (function () {\n      stat = fs.statSync('fizzle');\n    }).should.not.throw();\n    stat.atime.getFullYear().should.equal(1980);\n    stat.mtime.getFullYear().should.equal(1980);\n  });\n\n  it('should only change the access time with -a', function () {\n    cash.touch('fizzle', {\n      a: true,\n      date: '1 January 1976'\n    });\n    let stat;\n    (function () {\n      stat = fs.statSync('fizzle');\n    }).should.not.throw();\n    stat.atime.getFullYear().should.equal(1976);\n    stat.mtime.getFullYear().should.equal(1980);\n  });\n\n  it('should use another file\\'s times with --reference', function () {\n    cash.touch('wizzle', {\n      reference: 'fizzle'\n    });\n    let stat;\n    (function () {\n      stat = fs.statSync('wizzle');\n    }).should.not.throw();\n    stat.atime.getFullYear().should.equal(1976);\n    stat.mtime.getFullYear().should.equal(1980);\n  });\n\n  it('should use --time as an alias for -a or -m', function () {\n    cash.touch('fizzle', {\n      time: 'access',\n      date: '1 January 1972'\n    });\n    let stat;\n    (function () {\n      stat = fs.statSync('fizzle');\n    }).should.not.throw();\n    stat.atime.getFullYear().should.equal(1972);\n    stat.mtime.getFullYear().should.equal(1980);\n  });\n\n  it('should throw on invalid --time parameter', function () {\n    const results = cash.touch('fizzle', {\n      time: 'notime!'\n    });\n    results.should.containEql('touch: invalid argument \"notime!\"');\n  });\n\n  it('should throw on invalid --date parameter', function () {\n    const results = cash.touch('fizzle', {\n      date: 'at the prom?'\n    });\n    results.should.containEql('touch: invalid date format');\n  });\n\n  it('should throw on invalid --reference parameter', function () {\n    const results = cash.touch('fizzle', {\n      reference: 'themissingfile'\n    });\n    results.should.containEql('touch: failed to get attributes');\n  });\n});\n"
  },
  {
    "path": "test/true.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\ndescribe('true', function () {\n  it('should exist and be a function', function () {\n    should.exist(cash.true);\n  });\n\n  it('should do nothing when called', function () {\n    const results = cash.true();\n    console.log(typeof results);\n    results.should.equal('');\n  });\n\n  describe('programmatic use', function () {\n    it('should execute in vorpal mode sync', function () {\n      const result = cash('true');\n      result.should.equal('');\n    });\n  });\n});\n"
  },
  {
    "path": "test/unalias.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\n// Cleans all alias junk out of\n// localStorage.\nfunction clear() {\n  cash._aliases = {};\n  const ls = cash.vorpal.localStorage._localStorage;\n  cash.vorpal.localStorage.removeItem('aliases');\n  ls.keys = ls.keys.filter(function (key) {\n    if (String(key).indexOf('alias|') > -1) {\n      delete ls.metaKeyMap[key];\n      return false;\n    }\n  });\n}\n\ndescribe('alias', function () {\n  before(function () {\n    process.stdout.columns = 1000;\n    clear();\n  });\n\n  after(function () {\n    clear();\n  });\n\n  it('should exist and be a function', function () {\n    should.exist(cash.unalias);\n  });\n\n  it('should show usage when not passed anything', function () {\n    cash.unalias().should.equal('unalias: usage: unalias [-a] name [name ...]\\n');\n    cash.unalias('').should.equal('unalias: usage: unalias [-a] name [name ...]\\n');\n    cash.unalias([]).should.equal('unalias: usage: unalias [-a] name [name ...]\\n');\n  });\n\n  it('should remove an alias', function () {\n    cash.alias('foo=bar');\n    cash.alias('foo').should.equal('alias foo=\\'bar\\'\\n');\n    cash.unalias('foo');\n    cash.alias('foo').should.equal('-cash: alias: foo: not found\\n');\n  });\n\n  it('should remove multiple aliases', function () {\n    cash.alias('foo=bar');\n    cash.alias('fizz buzz');\n    cash.alias('foo').should.equal('alias foo=\\'bar\\'\\n');\n    cash.alias('fizz').should.equal('alias fizz=\\'buzz\\'\\n');\n    cash.unalias('foo fizz');\n    cash.alias('foo').should.equal('-cash: alias: foo: not found\\n');\n    cash.alias('fizz').should.equal('-cash: alias: fizz: not found\\n');\n  });\n\n  it('should chuck norris roundhouse kick you on an invalid alias', function () {\n    cash.unalias('foo');\n    cash.unalias('chucknorrisweakspot').should.equal('-cash: unalias: chucknorrisweakspot: not found\\n');\n  });\n\n  describe('-a', function () {\n    it('should remove all registered aliases', function () {\n      cash.alias('foo=bar');\n      cash.alias('fizz buzz');\n      cash.unalias(undefined, {a: true});\n      cash.alias('foo').should.equal('-cash: alias: foo: not found\\n');\n      cash.alias('fizz').should.equal('-cash: alias: fizz: not found\\n');\n    });\n  });\n});\n"
  },
  {
    "path": "test/util/playground.js",
    "content": "'use strict';\n\nconst cash = require('../../dist/index.js');\n\n\nlet result = cash('fooo!!!!!');\n\nconsole.log('!!!!!!!!!' + result);\nconsole.log('----------------');"
  },
  {
    "path": "test/util/util.js",
    "content": "'use strict';\n\nconst $ = require('shelljs');\nconst fs = require('fs-extra');\n\nmodule.exports = {\n\n  writeSampleDir(cb) {\n    // If tests fail mid, script cleanup doesn't happen.\n    // This makes sure we are in the right dir before\n    // trying to write.\n    if (String(process.cwd()).indexOf('/cash') === -1) {\n      process.chdir(`${__dirname}/../..`);\n    }\n\n    fs.removeSync('./testing');\n\n    $.mkdir('-p', './testing/');\n    $.mkdir('-p', './testing/sub/');\n\n    let filler = 'fill|';\n\n    function writeDir(dir, cbk) {\n      const files = ['a.txt', 'c.exe', 'd.json', 'e.gif', 'b.tgz', 'f.jpg', 'g', '.hidden'];\n      function write() {\n        const next = files.shift();\n        if (next) {\n          filler = double(filler);\n          new $.ShellString(filler).to(dir + next);\n          setTimeout(function () {\n            write();\n          }, 10);\n        } else {\n          cbk();\n        }\n      }\n      write();\n    }\n\n    writeDir('./testing/', function () {\n      writeDir('./testing/sub/', function () {\n        cb();\n      });\n    });\n  },\n\n  deleteSampleDir() {\n    fs.removeSync('./testing');\n  }\n};\n\nfunction double(str) {\n  return str + str + str.slice(0, 100);\n}\n"
  },
  {
    "path": "test/vorpal.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\nconst commands = require('../commands.json');\n\ndescribe('vorpal', function () {\n  it('should exist', function () {\n    should.exist(cash);\n  });\n\n  it('should execute all commands without erroring', function () {\n    (function () {\n      const cmds = commands.commands;\n      for (let i = 0; i < cmds.length; ++i) {\n        cash(`${cmds[i]}`);\n      }\n    }).should.not.throw();\n  });\n\n  it('should require commands without vorpal', function () {\n    (function () {\n      const cmds = commands.commands;\n      for (let i = 0; i < cmds.length; ++i) {\n        require(`../dist/commands/${cmds[i]}.js`)();\n      }\n    }).should.not.throw();\n  });\n});\n"
  },
  {
    "path": "test/which.js",
    "content": "'use strict';\n\nrequire('assert');\nconst should = require('should');\nconst cash = require('../dist/index.js');\n\ndescribe('true', function () {\n  it('should exist and be a function', function () {\n    should.exist(cash.which);\n  });\n\n  it('should do nothing when called', function () {\n    const results = cash.which();\n    console.log(typeof results);\n    results.should.equal('');\n  });\n\n  it('should find cmd when called', function () {\n    const results = cash.which('cmd');\n    console.log(typeof results);\n    results.should.not.equal('');\n  });\n});\n"
  },
  {
    "path": "test/windows.js",
    "content": "'use strict';\n\nrequire('assert');\nrequire('should');\nconst cash = require('../dist/index.js');\n\ndescribe('windows', function () {\n  it('execute a catch command', function () {\n    cash('cash-test');\n  });\n});\n"
  }
]