Suggests which tasks you wanted to call unless you made a typo
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tasks
test
.gitignore
.travis.yml
Gruntfile.js
README.md
console-example.png
index.js
package.json

README.md

grunt-similar Build Status

Suggests which tasks you wanted to call unless you made a typo

similar

Getting Started

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

##Install

npm install grunt-similar --save-dev

The "similar" task

Overview

Similar lets you be a normal human being and make mistakes in console. In case when grunt task you've written in console does not exist, similar is being executed and checks whether you've made a little typo or your cat is walking on your keyboard.

In case when the distance counted by Levenshtein algorythm between the task written and the one declared in config is sufficient, it executes the task you meant.

Options

  • distance Integer - difference distance allowed between entered and existing task name counted by Levenshtein algorythm. Default 3.

Basic Usage

module.exports = function(grunt){ 
	...
	similar: {
		options:{
			distance: 2
		},
		all: {}
	},
	...
	grunt.loadNpmTasks('grunt-similar');
	...
	//in the very bottom of the file after all the tasks are registered, but still 
	//within the function being exported. 
	require('grunt-similar').attach(grunt);
}

Example

##Contributing Feel free to open issues and send PRs, though make sure that you create tests for new functionality and amend ones for fixes and changes.

Versions are assigned according to SemVer specification.

Running tests

Run npm test in order to see test results.

License

The MIT License (MIT)

Copyright (c) 2014 Semenistyi Mykyta nikeiwe@gmail.com

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.