title: How to set the environment for Grunt?
body: <p>I defined a task section of my <code>Gruntfile.js</code> for two environments -- <code>development</code> and <code>production</code>. But I don't understand, how Grunt decides, wheter to use which environment section.</p>
  
  <p><strong><code>Gruntfile.js</code></strong></p>
  
  <pre><code>module.exports = function(grunt) {
  
    // Project configuration.
    grunt.initConfig({
      pkg: grunt.file.readJSON('package.json'),
      less: {
        development: {
          options: {
            paths: ["public/css"]
          },
          files: {
            "public/css/style.css": "public/css/style.less"
          }
        },
        production: {
          options: {
            paths: ["public/css"],
            plugins: [
            ],
            modifyVars: {
            }
          },
          files: {
            "public/css/style.css": "public/css/style.less"
          }
        }
      },
      watch: {
        css: {
          files: 'public/css/*.less',
          tasks: ['less'],
          options: {
            livereload: true,
          },
        },
      }
    });
  
    // Load the plugin that provides the "less" task.
    grunt.loadNpmTasks('grunt-contrib-less');
    // Load the plugin that provides the "watch" task.
    grunt.loadNpmTasks('grunt-contrib-watch');
  
    // Default task(s).
    grunt.registerTask('default', ['less', 'watch']);
  
  };
  </code></pre>
  
  <p>How to let Grunt know, which environment is currently active?</p>