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

Help text not working - issues with for (var x in array) #22

Open
glorat opened this issue Feb 3, 2019 · 3 comments
Open

Help text not working - issues with for (var x in array) #22

glorat opened this issue Feb 3, 2019 · 3 comments

Comments

@glorat
Copy link
Contributor

glorat commented Feb 3, 2019

This seems to be environment specific but in a couple of environments, the unfulfilled_args help text is not being displayed properly. It seems to relate to this piece of code at https://github.com/MeLlamoPablo/clapp/blob/master/lib/App.js#L268

					for (let i in unfulfilled_args) {
						r += unfulfilled_args[i.name] + "\n";
					}

The for loop assumes that i will be an Argument but in some enviroments it is simply the into the array. E.g.

> for (var x in [10,20,30]) {console.log(x)}
0
1
2

I'm not an expert in Javascript but a quick google suggests that using for/in over an array is apparently a bad idea, presumably because of this.

@glorat
Copy link
Contributor Author

glorat commented Feb 3, 2019

Based on the other open PRs, it seems you aren't actively maintaining this very fine library. I'll offer you a deal... if I submit a PR to fix this, would you review/accept and release a version to NPM?

@glorat
Copy link
Contributor Author

glorat commented Feb 3, 2019

Wow, I'd totally forgotten I've been here before. From a coding perspective, the code issue is basically the same as the one you kindly looked at and fixed back at #15

@MeLlamoPablo
Copy link
Owner

Hey there! Yes, you are right that I'm not actively maintaining this repo, but if you open a PR I'll be glad to release a new version :)

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