Skip to content

Commit

Permalink
Included examples for help and showHelp functions and fix…
Browse files Browse the repository at this point in the history
…ed few formatting issues
  • Loading branch information
thefourtheye committed Aug 23, 2013
1 parent 16b6d0e commit bbd1fe3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,31 @@ Format usage output to wrap at `columns` many columns.

Return the generated usage string.

Example:

```
var optimist = require("optimist")
.usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
console.log(optimist.help());
```

Later on, ```argv``` can be retrived with ```optimist.argv```

.showHelp(fn=console.error)
---------------------------

Print the usage data using `fn` for printing.

Example:

```
var optimist = require("optimist")
.usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
optimist.showHelp();
```

Later on, ```argv``` can be retrived with ```optimist.argv```

.parse(args)
------------

Expand Down Expand Up @@ -482,6 +502,7 @@ installation
============

With [npm](http://github.com/isaacs/npm), just do:

npm install optimist

or clone this project on github:
Expand Down

0 comments on commit bbd1fe3

Please sign in to comment.