harthur/nomnom — Issue #16: Process exits before displaying a large number of options (-h)
Author: tmarshall
Created: 2012-03-01 18:26:55+00:00
State: open

With a small number of options the output seems to work fine.

But with a long list, the process exits before finishing the console log. And it seems to get worse if you have longer help attributes.

Example options:

```javascript
var opts = require('nomnom')
.options({
aa: {
required: false,
help: 'OPTIONAL: aa is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true
},
bb: {
abbr: 'b',
required: false,
help: 'OPTIONAL: bb is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
metavar: 'NUMBER',
'default': 10
},
cc: {
required: false,
help: 'OPTIONAL: cc is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
dd: {
abbr: 'd',
required: false,
help: 'OPTIONAL: dd is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
metavar: 'DD_STR'
},
ee: {
required: false,
help: 'OPTIONAL: ee is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
ff: {
required: false,
help: 'OPTIONAL: ff is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
gg: {
required: false,
help: 'OPTIONAL: gg is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
hh: {
required: false,
help: 'OPTIONAL: hh is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
ii: {
required: false,
help: 'OPTIONAL: ii is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
jj: {
required: false,
help: 'OPTIONAL: jj is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
kk: {
required: false,
help: 'OPTIONAL: kk is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
ll: {
required: false,
help: 'OPTIONAL: ll is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
mm: {
required: false,
help: 'OPTIONAL: mm is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
nn: {
required: false,
help: 'OPTIONAL: nn is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
oo: {
required: false,
help: 'OPTIONAL: oo is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
pp: {
required: false,
help: 'OPTIONAL: pp is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
qq: {
required: false,
help: 'OPTIONAL: qq is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
},
rr: {
required: false,
help: 'OPTIONAL: rr is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0',
flag: true,
'default': false
}
}).parse();
```

And the help output:

usage: node test [options]

options:
--aa OPTIONAL: aa is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
-b NUMBER, --bb NUMBER OPTIONAL: bb is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
--cc OPTIONAL: cc is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
-d DD_STR, --dd DD_STR OPTIONAL: dd is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
--ee OPTIONAL: ee is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
--ff OPTIONAL: ff is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
--gg OPTIONAL: gg is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
--hh OPTIONAL: hh is an example - with a decently long help string - 1 2 3 4 5 6 7 8 9 0
--ii OPTIONAL: ii is an example - with a decently long