Skip to content

Latest commit

 

History

History
99 lines (69 loc) · 1.11 KB

README.md

File metadata and controls

99 lines (69 loc) · 1.11 KB

qo

A task runner for insect people.

install

npm install qo

how to use

Write a file qo.js:

task('hi', function () {
  console.log('hi!');
});

Then

# qo hi
hi!

named arguments

task('hi', function (args, options) {
  console.log("hi " + options.name)"
});

Then

# qo hi --name jack
hi jack

lists of arguments

task('hi', function (args) {
  console.log("hi " + args.join(', '));
});

Then

# qo hi jack jill jesse
hi jack, jill, jesse

promises

If you return a promise, and it's rejected, then qo will print the error exit with 1.

ncp = require 'ncp'
var fs = require('fs-promise');

task('print', function (args) {
  return fs.readFile(args[0], 'utf-8').then(function (contents) {
    console.log(contents);
  });
});

Then

# qo print some-file.txt
Error: ENOENT, open 'asdf'
    at Error (native)

task descriptions

task('hi', {desc: 'says hi'}, function () {
  console.log('hi');
});

Then

# qo
tasks:

    hi, says hi

pogoscript

you can write a qo.pogo file too