question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

minimist argument as string with space breaking

See original GitHub issue

I have an argument --test="hello world".

Using minimist not through this library the output is

{ _: [], test: 'hello world' }

Using this library it separates the string values into

{ _: [ 'world\'' ],  test: '\'hello' }

I noticed you parse the arguments, but I think something seems a bit off.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
JasonEtcocommented, Apr 12, 2019

That’d be wonderful, thanks ❤️

1reaction
JasonEtcocommented, Apr 12, 2019

That makes sense - you’ve got quotes around the array:

- args = "[ 1, 'To do']"
+ args = [ 1, "To do"]

I think that single quotes vs. double quotes matters, or at least they’re being syntax-highlighted differently.

ooh and it apparently doesn’t like numbers:

args = [ "1", "To do"]
Read more comments on GitHub >

github_iconTop Results From Across the Web

passing string with spaces to node cli-parser - Stack Overflow
If what you need to do is break up a single string into arguments like the shell does, that is not done by...
Read more >
minimist-string - npm
A minimist extension to parse command line sentences as strings. Latest version: 1.0.2, last published: 6 years ago.
Read more >
Errors in pygmt when there are spaces in string arguments
The problem seems to be that in parsing of arguments in pygmt, string arguments containing spaces are broken up into separate arguments ......
Read more >
Handling and Processing Strings in R - GitHub Pages
By default, the strings are concatenated with a space character as separator. ... The argument fill allows us to break long strings; this...
Read more >
Parses command line arguments. Port & rewrite of the node ...
Port & rewrite to deno & typescript of the node library minimist. ... opts.string - a string or array of strings argument names...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found