Skip to content

Commit 2bcc53d

Browse files
committed
[bin dist] Version bump. Small fixes from 0.2.5
1 parent faacc0f commit 2bcc53d

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

bin/forever

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ var mappings = {
5757
'e': 'errfile'
5858
};
5959

60-
// Show help prompt if requested
61-
if (argv.h || argv.help) {
60+
// Show help prompt if requested or if the
61+
// incorrect usage options are supplied
62+
if (argv.h || argv.help || Object.keys(argv).length === 2
63+
|| argv._.length === 0) {
6264
sys.puts(help);
6365
return;
6466
}
@@ -70,7 +72,16 @@ var file = argv._[0];
7072

7173
// Setup pass-thru options for child-process
7274
var options = {};
73-
options.options = process.argv.splice(process.argv.indexOf(file) + 1);
75+
options.options = process.argv.splice(process.argv.indexOf(file)).splice(1);
76+
77+
// Now that we've removed the target script options
78+
// reparse the options and setup the forever settings
79+
argv = require('optimist').argv;
80+
Object.keys(argv).forEach(function (key) {
81+
if (mappings[key]) {
82+
options[mappings[key]] = argv[key];
83+
}
84+
});
7485

7586
// If max isn't specified set it to run forever
7687
if (typeof options['max'] === 'undefined') {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "forever",
33
"description": "A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)",
4-
"version": "0.2.5",
4+
"version": "0.2.6",
55
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
66
"contributors": [
77
{ "name": "Fedor Indutny", "email": "fedor.indutny@gmail.com" }
@@ -13,7 +13,7 @@
1313
"keywords": ["cli", "fault tolerant", "sysadmin", "tools"],
1414
"dependencies": {
1515
"daemon": ">= 0.1.0",
16-
"optimist": ">= 0.0.3",
16+
"optimist": ">= 0.0.6",
1717
"vows": ">= 0.5.1",
1818
},
1919
"bin": { "forever": "./bin/forever" },

0 commit comments

Comments
 (0)