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

--set command doesn't work when only passing one of them #1

Closed
florianbreier opened this issue Feb 28, 2019 · 0 comments
Closed

--set command doesn't work when only passing one of them #1

florianbreier opened this issue Feb 28, 2019 · 0 comments
Assignees

Comments

@florianbreier
Copy link
Owner

1. Passing a single --set option:  `winser -i -s --set "Application C:\path\of\some\kind.exe"` returns with error message:  _Set operation failed (e)_

2. Passing multiple set options:  `winser -i -s --set "Application C:\path\of\some\kind.exe" --set "AppParameters start"` works fine.

Watching typeof options.set in the debugger in both circumstances it appears when passing a single --set argument options.set type is 'string', however when passing more than one it is of type 'object', specifically upon further inspection, it is an array as expected.

Line #313 in the current file async.each(options.set, appears to expect an array in all cases and thus fails for the first case listed above.

I am not sure if this is how stdio.getopts is intended to work or not, but I think it's a bug here none the less. I'll submit a pull request if author doesn't address this. There may be other areas of the code where this is a problem, probably any args marked as expecting mutiple.

Note if you need the current code to work with one -set argument you can pass a second --set option that is just a single space, or anything really, except nothing or empty string. You will get an error message stating 'Set operation failed ( )' for the second arg if it isn't a valid arg, but the first one will work as expected.

Windows 8.1 Enterprise
node v0.12.0
npm v2.5.1
winser v^1.0.2

jfromaniello#40

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

1 participant