Question: I have a question regarding a select mysql query. Lets say that we have 2 tables

users: [ id, username ]
logs [ id, user\_id, action ]

I want to selecr all users from table users with the count(`id`) of table logs based on user\_id

I tried to do the following:

```
SELECT t1.*,count(t2.`id`) 
FROM `users` t1
LEFT JOIN `logs` t2 
ON  t1.id = t2.user_id;

```

But that only prints the users who have count logs > 0. I want to select all the users with the count of the logs.

Answer: 
I built a plugin to inject parameters from the commandline into the task callback.

```
gulp.task('mytask', function (production) {
  console.log(production); // => true
});

// gulp mytask --production

```

<https://github.com/stoeffel/gulp-param>

If someone finds a bug or has a improvement to it, I am happy to merge PRs.
We wanted to pass a different config file for different environments -- one for **production**, **dev** and **testing**. This is the code in the gulp file:

```js
//passing in flag to gulp to set environment
//var env = gutil.env.env;

if (typeof gutil.env.env === 'string') {
  process.env.NODE_ENV = gutil.env.env;
}
```

This is the code in the app.js file:

```js
  if(env === 'testing'){
      var Config = require('./config.testing.js');
      var Api = require('./api/testing.js')(Config.web);
    }
    else if(env === 'dev'){
       Config = require('./config.dev.js');
        Api = require('./api/dev.js').Api;
    }
    else{
       Config = require('./config.production.js');
       Api = require('./api/production.js')(Config.web);
    }
```

And then to run it gulp `--env=testing`