Skip to content

Commit

Permalink
Fix unstripped argv.
Browse files Browse the repository at this point in the history
See #134.
  • Loading branch information
flatheadmill committed Sep 18, 2015
1 parent a269fbf commit 9b8c81d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions invoke.js
Expand Up @@ -101,9 +101,9 @@ module.exports = cadence(function (async, source, env, argv, io, main) {

// set options object properties
options.command = command

options.argv = argv.slice(command.length)
// parse arguments
options.given = getopt(usage.getPattern(command), options.params, argv.slice(command.length), function (message) {
options.given = getopt(usage.getPattern(command), options.params, options.argv, function (message) {
options.abend(message)
})
options.param = {}
Expand Down
5 changes: 3 additions & 2 deletions t/arguable/run.t.js
Expand Up @@ -108,8 +108,9 @@ var prove = cadence(function (async, assert) {
}), function (error, code) {
assert(error.context.message, 'command required', 'command missing')
})
run(path.join(__dirname, 'sub.js'), {}, [ 'run', '-p', 3 ], {
run(path.join(__dirname, 'sub.js'), {}, [ 'run', '-p', 3, 'x' ], {
}, cadence(function (async, options) {
assert(options.argv, [ 'x' ], 'correct sub command argv')
assert(options.param.processes, 3, 'correct sub command arguments pattern')
return 0
}), function (error, code) {
Expand Down Expand Up @@ -155,4 +156,4 @@ var prove = cadence(function (async, assert) {
io.events.emit('SIGINT')
})

require('proof')(27, prove)
require('proof')(28, prove)

0 comments on commit 9b8c81d

Please sign in to comment.