-
Notifications
You must be signed in to change notification settings - Fork 995
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated readme with .default() stuff
- Loading branch information
James Halliday
committed
Dec 1, 2010
1 parent
cd7f8c5
commit 656a1d5
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env node | ||
|
||
var argv = require('optimist') | ||
.default({ x : 10, y : 10 }) | ||
.argv | ||
; | ||
|
||
var x = parseInt(argv.x, 10); | ||
var y = parseInt(argv.y, 10); | ||
console.log(x + y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env node | ||
|
||
var argv = require('optimist') | ||
.default('x', 10) | ||
.default('y', 10) | ||
.argv | ||
; | ||
|
||
var x = parseInt(argv.x, 10); | ||
var y = parseInt(argv.y, 10); | ||
console.log(x + y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters