pax_global_header00006660000000000000000000000064126776140320014522gustar00rootroot0000000000000052 comment=edd8bd29a72f2f28b63fe2629fcb7b9d9f2feb46 grunt-cli-1.2.0/000077500000000000000000000000001267761403200134265ustar00rootroot00000000000000grunt-cli-1.2.0/.gitignore000066400000000000000000000000371267761403200154160ustar00rootroot00000000000000node_modules npm-debug.log tmp grunt-cli-1.2.0/.jshintrc000066400000000000000000000003211267761403200152470ustar00rootroot00000000000000{ "boss": true, "curly": true, "eqeqeq": true, "immed": true, "latedef": true, "newcap": true, "noarg": true, "node": true, "strict": true, "sub": true, "undef": true, "unused": true } grunt-cli-1.2.0/.travis.yml000066400000000000000000000001151267761403200155340ustar00rootroot00000000000000sudo: false language: node_js node_js: - '5' - '4' - '0.12' - '0.10' grunt-cli-1.2.0/AUTHORS000066400000000000000000000002201267761403200144700ustar00rootroot00000000000000Tyler Kellen (http://goingslowly.com) Ben Alman (http://gruntjs.com) Scott González (http://nemikor.com) Forbes Lindesay (https://github.com/) grunt-cli-1.2.0/CHANGELOG.md000066400000000000000000000014341267761403200152410ustar00rootroot00000000000000- v1.2.0 - date: 2016-04-01 - changes: - Use shared grunt-known-options module. - v1.1.0 - date: 2016-03-22 - changes: - Update to "nopt": "~3.0.6". - nopt is upgraded to ~3.0.6 which has fixed many issues, including passing multiple arguments and dealing with numbers as options. Be aware previously --foo bar used to pass the value 'bar' to the option foo. It will now set the option foo to true and run the task bar. - v1.0.1 - date: 2016-03-22 - changes: - Revert to "nopt": "~1.0.10" due to issues with the update. - v1.0.0 - date: 2016-03-21 - changes: - Update dev deps - Update error message when Gruntfile is not found - v1.0.0-rc1 - date: 2016-02-11 - changes: - Update findup-sync and other deps - remove prefer global warning grunt-cli-1.2.0/Gruntfile.js000066400000000000000000000012711267761403200157240ustar00rootroot00000000000000/* * grunt-cli * http://gruntjs.com/ * * Copyright (c) 2016 Tyler Kellen, contributors * Licensed under the MIT license. * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT */ 'use strict'; module.exports = function(grunt) { // Project configuration. grunt.initConfig({ jshint: { all: [ 'bin/*', 'lib/**/*.js', 'Gruntfile.js' ], options: { jshintrc: '.jshintrc' } }, }); // These plugins provide necessary tasks. grunt.loadNpmTasks('grunt-contrib-jshint'); // "npm test" runs these tasks grunt.registerTask('test', ['jshint']); // Default task. grunt.registerTask('default', ['test']); }; grunt-cli-1.2.0/LICENSE-MIT000066400000000000000000000020561267761403200150650ustar00rootroot00000000000000Copyright (c) 2016 Tyler Kellen, contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. grunt-cli-1.2.0/README.md000066400000000000000000000033031267761403200147040ustar00rootroot00000000000000# grunt-cli [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-cli.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-cli) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/prp6g944b05jsq6d/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-cli/branch/master) > The Grunt command line interface. Install this globally and you'll have access to the `grunt` command anywhere on your system. ```shell npm install -g grunt-cli ``` **Note:** The job of the `grunt` command is to load and run the version of Grunt you have installed locally to your project, irrespective of its version. Starting with Grunt v0.4, you should never install Grunt itself globally. For more information about why, [please read this](http://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation). See the [Getting Started](http://gruntjs.com/getting-started) guide for more information. ## Shell tab auto-completion To enable tab auto-completion for Grunt, add one of the following lines to your `~/.bashrc` or `~/.zshrc` file. ```bash # Bash, ~/.bashrc eval "$(grunt --completion=bash)" ``` ```bash # Zsh, ~/.zshrc eval "$(grunt --completion=zsh)" ``` ## Installing grunt-cli locally If you prefer the idiomatic Node.js method to get started with a project (`npm install && npm test`) then install grunt-cli locally with `npm install grunt-cli --save-dev`. Then add a script to your `package.json` to run the associated grunt command: `"scripts": { "test": "grunt test" } `. Now `npm test` will use the locally installed `./node_modules/.bin/grunt` executable to run your Grunt commands. To read more about npm scripts, please visit the npm docs: . grunt-cli-1.2.0/appveyor.yml000066400000000000000000000017531267761403200160240ustar00rootroot00000000000000# http://www.appveyor.com/docs/appveyor-yml clone_depth: 10 version: "{build}" # What combinations to test environment: matrix: - nodejs_version: "0.10" platform: x86 - nodejs_version: "0.12" platform: x86 - nodejs_version: "4" platform: x64 - nodejs_version: "4" platform: x86 - nodejs_version: "5" platform: x86 install: - ps: Install-Product node $env:nodejs_version $env:platform - ps: >- if ($env:nodejs_version -eq "0.10") { npm -g install npm@3 $env:PATH="$env:APPDATA\npm;$env:PATH" } - npm install test_script: # Output useful info for debugging - node --version && npm --version # We test multiple Windows shells because of prior stdout buffering issues # filed against Grunt. https://github.com/joyent/node/issues/3584 - ps: "npm test # PowerShell" # Pass comment to PS for easier debugging - cmd: npm test build: off matrix: fast_finish: true cache: - node_modules -> package.json grunt-cli-1.2.0/bin/000077500000000000000000000000001267761403200141765ustar00rootroot00000000000000grunt-cli-1.2.0/bin/grunt000077500000000000000000000022061267761403200152630ustar00rootroot00000000000000#!/usr/bin/env node 'use strict'; process.title = 'grunt'; // Especially badass external libs. var findup = require('findup-sync'); var resolve = require('resolve').sync; // Internal libs. var options = require('../lib/cli').options; var completion = require('../lib/completion'); var info = require('../lib/info'); var path = require('path'); var basedir = process.cwd(); var gruntpath; // Do stuff based on CLI options. if ('completion' in options) { completion.print(options.completion); } else if (options.version) { info.version(); } else if (options.gruntfile) { //Note: if both `gruntfile` and `base` are set, use `gruntfile` basedir = path.resolve(path.dirname(options.gruntfile)); } else if (options.base) { basedir = path.resolve(options.base); } try { gruntpath = resolve('grunt', {basedir: basedir}); } catch (ex) { gruntpath = findup('lib/grunt.js'); // No grunt install found! if (!gruntpath) { if (options.version) { process.exit(); } if (options.help) { info.help(); } info.fatal('Unable to find local grunt.', 99); } } // Everything looks good. Require local grunt and run it. require(gruntpath).cli(); grunt-cli-1.2.0/completion/000077500000000000000000000000001267761403200155775ustar00rootroot00000000000000grunt-cli-1.2.0/completion/bash000077500000000000000000000030131267761403200164370ustar00rootroot00000000000000#!/bin/bash # grunt-cli # http://gruntjs.com/ # # Copyright (c) 2016 Tyler Kellen, contributors # Licensed under the MIT license. # https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT # Usage: # # To enable bash completion for grunt, add the following line (minus the # leading #, which is the bash comment character) to your ~/.bashrc file: # # eval "$(grunt --completion=bash)" # Search the current directory and all parent directories for a gruntfile. function _grunt_gruntfile() { local curpath="$PWD" while [[ "$curpath" ]]; do for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do if [[ -e "$gruntfile" ]]; then echo "$gruntfile" return fi done curpath="${curpath%/*}" done return 1 } # Enable bash autocompletion. function _grunt_completions() { # The currently-being-completed word. local cur="${COMP_WORDS[COMP_CWORD]}" # The current gruntfile, if it exists. local gruntfile="$(_grunt_gruntfile)" # The current grunt version, available tasks, options, etc. local gruntinfo="$(grunt --version --verbose 2>/dev/null)" # Options and tasks. local opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')" local compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')" # Only add -- or - options if the user has started typing - [[ "$cur" == -* ]] && compls="$compls $opts" # Tell complete what stuff to show. COMPREPLY=($(compgen -W "$compls" -- "$cur")) } complete -o default -F _grunt_completions grunt grunt-cli-1.2.0/completion/zsh000077500000000000000000000023051267761403200163310ustar00rootroot00000000000000#!/bin/zsh # grunt-cli # http://gruntjs.com/ # # Copyright (c) 2016 Tyler Kellen, contributors # Licensed under the MIT license. # https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT # Usage: # # To enable zsh completion for grunt, add the following line (minus the # leading #, which is the zsh comment character) to your ~/.zshrc file: # # eval "$(grunt --completion=zsh)" # Enable zsh autocompletion. function _grunt_completion() { local completions # The currently-being-completed word. local cur="${words[@]}" # The current grunt version, available tasks, options, etc. local gruntinfo="$(grunt --version --verbose 2>/dev/null)" # Options and tasks. local opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')" local compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')" # Only add -- or - options if the user has started typing - [[ "$cur" == -* ]] && compls="$compls $opts" # Trim whitespace. compls=$(echo "$compls" | sed -e 's/^ *//g' -e 's/ *$//g') # Turn compls into an array to of completions. completions=(${=compls}) # Tell complete what stuff to show. compadd -- $completions } compdef _grunt_completion grunt grunt-cli-1.2.0/lib/000077500000000000000000000000001267761403200141745ustar00rootroot00000000000000grunt-cli-1.2.0/lib/cli.js000066400000000000000000000014301267761403200152770ustar00rootroot00000000000000/* * grunt-cli * http://gruntjs.com/ * * Copyright (c) 2016 Tyler Kellen, contributors * Licensed under the MIT license. * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT */ 'use strict'; // External lib. var nopt = require('nopt'); var gruntOptions = require('grunt-known-options'); // Parse `gruntOptions` into a form that nopt can handle. exports.aliases = {}; exports.known = {}; Object.keys(gruntOptions).forEach(function(key) { var short = gruntOptions[key].short; if (short) { exports.aliases[short] = '--' + key; } exports.known[key] = gruntOptions[key].type; }); // Parse them and return an options object. Object.defineProperty(exports, 'options', { get: function() { return nopt(exports.known, exports.aliases, process.argv, 2); } }); grunt-cli-1.2.0/lib/completion.js000066400000000000000000000014021267761403200167000ustar00rootroot00000000000000/* * grunt-cli * http://gruntjs.com/ * * Copyright (c) 2016 Tyler Kellen, contributors * Licensed under the MIT license. * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT */ 'use strict'; // Nodejs libs. var fs = require('fs'); var path = require('path'); exports.print = function(name) { var code = 0; var filepath = path.join(__dirname, '../completion', name); var output; try { // Attempt to read shell completion file. output = String(fs.readFileSync(filepath)); } catch (err) { code = 5; output = 'echo "Specified grunt shell auto-completion rules '; if (name && name !== 'true') { output += 'for \'' + name + '\' '; } output += 'not found."'; } console.log(output); process.exit(code); }; grunt-cli-1.2.0/lib/info.js000066400000000000000000000023251267761403200154670ustar00rootroot00000000000000/* * grunt-cli * http://gruntjs.com/ * * Copyright (c) 2016 Tyler Kellen, contributors * Licensed under the MIT license. * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT */ 'use strict'; // Project metadata. var pkg = require('../package.json'); // Display grunt-cli version. exports.version = function() { console.log('grunt-cli v' + pkg.version); }; // Show help, then exit with a message and error code. exports.fatal = function(msg, code) { exports.helpHeader(); console.log('Fatal error: ' + msg); console.log(''); exports.helpFooter(); process.exit(code); }; // Show help and exit. exports.help = function() { exports.helpHeader(); exports.helpFooter(); process.exit(); }; // Help header. exports.helpHeader = function() { console.log('grunt-cli: ' + pkg.description + ' (v' + pkg.version + ')'); console.log(''); }; // Help footer. exports.helpFooter = function() { [ 'If you\'re seeing this message, grunt hasn\'t been installed locally to', 'your project. For more information about installing and configuring grunt,', 'please see the Getting Started guide:', '', 'http://gruntjs.com/getting-started', ].forEach(function(str) { console.log(str); }); }; grunt-cli-1.2.0/package.json000066400000000000000000000012631267761403200157160ustar00rootroot00000000000000{ "name": "grunt-cli", "description": "The grunt command line interface", "version": "1.2.0", "author": "Grunt Development Team (http://gruntjs.com/development-team)", "repository": "gruntjs/grunt-cli", "license": "MIT", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "node bin/grunt test" }, "bin": { "grunt": "bin/grunt" }, "dependencies": { "findup-sync": "~0.3.0", "grunt-known-options": "~1.1.0", "nopt": "~3.0.6", "resolve": "~1.1.0" }, "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-jshint": "~1.0.0" }, "files": [ "bin", "completion", "lib" ], "appveyor_id": "prp6g944b05jsq6d" }