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

Incorrect handling of values beginning with - (dash) #16

Closed
topaz1008 opened this issue Dec 28, 2022 · 1 comment
Closed

Incorrect handling of values beginning with - (dash) #16

topaz1008 opened this issue Dec 28, 2022 · 1 comment

Comments

@topaz1008
Copy link

topaz1008 commented Dec 28, 2022

Hello.

I have come across a problem with handling key-value options where the value starts with a - (dash) and there is no = (equals) sign.
I am using Windows10 and Node.js v18.12.1

Describe the exact steps which reproduce the problem

// test.js
import minimist from 'minimist';

const options = minimist(process.argv.slice(2));
console.log(options);

Running the following command gives this output:

> node test.js --command "-c:v copy"
{ _: [], command: true, c: ':v copy' }

Expected output:

> node test.js --command "-c:v copy"
{ _: [], command: '-c:v copy' }

When writing out the command using an = (equals), it works as expected.
e.g.

> node test.js --command="-c:v copy"
{ _: [], command: '-c:v copy' }
@topaz1008
Copy link
Author

#15

@topaz1008 topaz1008 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2022
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