clapp icon indicating copy to clipboard operation
clapp copied to clipboard

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

Open glorat opened this issue 7 years ago • 3 comments

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 avatar Feb 03 '19 09:02 glorat

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 avatar Feb 03 '19 09:02 glorat

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 https://github.com/MeLlamoPablo/clapp/issues/15

glorat avatar Feb 03 '19 09:02 glorat

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 :)

MeLlamoPablo avatar Feb 04 '19 07:02 MeLlamoPablo