Skip to content

Commit

Permalink
[doc] Add dispatch call to CLI doc
Browse files Browse the repository at this point in the history
  • Loading branch information
apeace authored and jfhbrook committed Dec 30, 2011
1 parent 6d3549c commit 46e0b2d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ Director supports Command Line Interface routing. Routes for cli options are bas
router.on(/destroy/, function () {
console.log('destroy something');
});

router.dispatch('on', process.argv.slice(2).join(' '));
```

When the script is run (we'll call it `cli-program.js`), it will route based on the command you give it:

``` bash
$ node cli-program.js create
create something
$ node cli-program.js destroy
destroy something
```

<a name="api-documentation"></a>
Expand Down

0 comments on commit 46e0b2d

Please sign in to comment.