#!/usr/bin/env node
import osia from '.';
import minimist from 'minimist';
import list from 'cli-list';
import routine from 'promise-routine';
import { join } from 'path';

const args = process.argv.slice(2);
const sets = list(args);
const opts = minimist(args);
const tasks = [];

// Setup CLI for routine
if (sets.length > 1 || opts.i) {
  sets.forEach(set => {
    const mic = minimist(set.slice(1));
    tasks.push([set[0], mic, mic._]);
  });
} else {
  sets[0].forEach(task => tasks.push([task, {}, {}]));
}

// Run the config, which defines the tasks.
require(join(process.cwd(), 'osia.js'));

// Start
routine((...o) => osia.run(...o), ...tasks);

@@ -212,24 +212,28 @@
 nst 
-se
+op
 ts = 
-l
+minim
 ist(args
 );%0Ac
@@ -220,32 +220,51 @@
  = minimist(args
+, %7B boolean: true %7D
 );%0Aconst opts = 
@@ -256,36 +256,34 @@
 ;%0Aconst 
-op
+se
 ts = 
-minimist(args
+list(opts._
 );%0Aconst
@@ -410,17 +410,8 @@
 (set
-.slice(1)
 );%0A 
@@ -443,16 +443,25 @@
 c, mic._
+.slice(1)
 %5D);%0A  %7D)
@@ -529,16 +529,93 @@
 %5D));%0A%7D%0A%0A
+if (opts.b %7C%7C opts.babel) %7B%0A  require(require.resolve('babel-register'));%0A%7D%0A%0A
 // Run t

Add babel-register under -b flag for ES6 tasks