Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec() does not support variadic arguments #195

Open
donmccurdy opened this issue Sep 2, 2020 · 0 comments
Open

exec() does not support variadic arguments #195

donmccurdy opened this issue Sep 2, 2020 · 0 comments
Assignees

Comments

@donmccurdy
Copy link
Contributor

Describe the bug
When used programmatically with exec(), only the first variadic argument is passed to the command.

To Reproduce
Steps to reproduce the behavior:

const { program } = require('@caporal/core');

program
	.command('join', 'join many strings')
	.argument('<str...>', 'strings')
	.action(async ({args}) => {
		console.log('ARGS: ', args);
	});

program.exec(['join', 'a', 'b', 'c', 'd'], {silent: true});

Expected behavior

❯ node packages/cli/test/quick-test.js
ARGS:  { str: ['a', 'b', 'c', 'd'] }

Actual behavior

❯ node packages/cli/test/quick-test.js
ARGS:  { str: 'a' }

Environment informations (please complete the following information):

  • OS: macOS
  • OS version: 10.15.6
  • Shell: zsh
  • Caporal version: 2.0.2
@donmccurdy donmccurdy changed the title exec() programmatic usage does not support variadic arguments exec() does not support variadic arguments Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants