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.
And if you are using typescript (`gulpfile.ts`) then do this for `yargs` (building on @Caio Cunha's excellent answer <https://stackoverflow.com/a/23038290/1019307> and other comments above):

Install
-------

```
npm install --save-dev yargs

typings install dt~yargs --global --save

```

### `.ts` files

Add this to the .ts files:

```
import { argv } from 'yargs';

...

  let debug: boolean = argv.debug;

```

This has to be done in each .ts file individually (even the `tools/tasks/project` files that are imported into the `gulpfile.ts/js`).

Run
---

```
gulp build.dev --debug

```

Or under `npm` pass the arg through to gulp:

```
npm run build.dev -- --debug

```