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

allow non string values to be passed for values #46

Closed
wants to merge 1 commit into from

Conversation

lee-elenbaas
Copy link

allows for parsing of arrays like: ['--param', 15]

@nexdrew
Copy link
Member

nexdrew commented Aug 8, 2016

Before we review this, would you mind describing the use-case(s) this will help solve apart from doing something like the following?

var parse = require('yargs-parser')
parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to single string
parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings

EDIT: Note that I'm not opposed to this idea, but I want to make sure that:

  1. It's clear that this is a worthwhile change
  2. We implement this as robustly as possible (I think I see a few problems with your changes)

Thanks for offering this, btw! Looking forward to your thoughts and discussion.

@bcoe
Copy link
Member

bcoe commented Aug 9, 2016

@lee-elenbaas I think I'd rather keep the explicit contract that yargs-parser expects an array of strings, does @nexdrew's suggestion of:

parse(['-f', 11, '--zoom', 55].map(String))

provide a reasonable workaround for you?

@lee-elenbaas
Copy link
Author

It is the workaround i am currently using - at the very least - that contract should be documented

@nexdrew
Copy link
Member

nexdrew commented Aug 10, 2016

at the very least - that contract should be documented

@lee-elenbaas Sounds reasonable to me. Thanks for bringing this up and for your understanding in this matter!

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.

3 participants