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

add type inference option #19

Closed
wants to merge 3 commits into from
Closed

add type inference option #19

wants to merge 3 commits into from

Conversation

SamVerschueren
Copy link
Contributor

Adds the option inferType to the options object. It's false by default which means that command line arguments are not parsed. (fixes #17)

Also fixed tests with latest AVA.

test('spawn cli and show version', t => {
t.plan(2);
test('spawn cli and show version', async t => {
const {stdout} = await execa('./fixture.js', ['--version'], {cwd: __dirname});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to set cwd. It's always __dirname.


Set it to `true` to enable argument type inference.

###### example
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the example.

@sindresorhus
Copy link
Owner

Thank you! And sorry about the delay :)

@SamVerschueren
Copy link
Contributor Author

No problem, you have so much stuff to do :) . Thanks for merging!

@williamboman
Copy link

Any ETA on new release? Was reading the docs and could not figure out why it would keep inferring types. Also, wouldn't this break BC if it defaults to false?

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

Successfully merging this pull request may close these issues.

Turn off cli args type detection by default
3 participants