List grunt.js tasks

Gruntjs

Gruntjs Problem Overview


I'm trying to work out how to print a list of all available grunt tasks. With rake it would be:

$ rake -T

What's the equivalent for grunt? e.g.

$ grunt -T

  • concat
  • jasmine
  • minify

Gruntjs Solutions


Solution 1 - Gruntjs

grunt --help lists available tasks.

Solution 2 - Gruntjs

Workaround for the list in sh/bash in case you need to trigger something and can't modify the original code:

grunt -h --no-color | sed -n '/^Available tasks/,/^$/ {s/^  *\([^ ]\+\)  [^ ]\+.*$/\1/p}'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionopsbView Question on Stackoverflow
Solution 1 - GruntjstJenerView Answer on Stackoverflow
Solution 2 - GruntjsestaniView Answer on Stackoverflow