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.

Unable to replace with a dash involved

See original GitHub issue

This command fails:

renamer --find '_Small' --replace '-sm'

because it thinks -sm is another command line flag that it doesn’t recognize. I assume this is actually an issue with what library you’re using for argument parsing, but I thought you would want to know, as there are plenty of other argument parsers to choose from. Here’s the output:

screen shot 2016-02-22 at 12 16 42 pm

As you can see, it confuses the program a bit.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

75lbcommented, Dec 3, 2016

Fixed and released in renamer v0.6.1.

The “Unable to replace with a dash involved” issue is resolved within the command-line-args module, which renamer uses.

See here for a description how to avoid ambiguous values. In summary, you use --option=value notation, for example:

renamer --find '_Small' --replace='-sm'
ismyrnowcommented, Apr 8, 2016

I get similar output for the guide using the standard command prompt on Windows 7, and node 0.10 (not my typical environment, but possibly worth mentioning). The font there is “Terminal”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

with a single space? Replace method not working
In your code, I only see .Replace(" ", "-"); (eg. Replace space with dash ). I don't see what you describe, which is...
Read more >
Autoformat converts some hyphens to long dashes in Word
This appears when you move the pointer over the corrected hyphen. Then, click Undo Dash. When you use AutoCorrect Options, you can also...
Read more >
55292 – autocorrect does not correct two dashes to ... - Bugzilla
If one sets auto-correct to correct two dashes (--) with an em-dash, auto-correct only works if the double-dash is discreet (separated from ...
Read more >
Can't replace em dashes imported as question marks in string
I just wanted to throw a line in there to replace question marks with a hyphen. When I try to match on "?"...
Read more >
Inserting a true dash by replacing a hyphen with a dash
John Dixon, independent medical writer and trainer in scientific writing skills, provides a useful tip for medical writers who work in ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found