Command Line - Find with leading dash (-) throws error


Using fnr.exe from the command line, I found that searching with a leading dash (-) throws an error. For example --find "-E" fails with the error "--find required option is missing"


panny2406 wrote Jul 1, 2016 at 2:33 PM

This is also true for the value of the --replace parameter

adrianmanb wrote Mar 25 at 4:52 PM

I confirm this bug. Leading with a dash "-" throws an error from command line, although not the same between --find or --replace. Example:

fnr.exe --cl --dir "D:\animals" --fileMask "animals.txt" --find "rats" --replace "-bugs"

If the parameter leads with a dash but is a number, it does work, for instance:

fnr.exe --cl --dir "D:\animals" --fileMask "animals.txt" --find "rats" --replace "-123"

works fine.

WORKAROUND: --useEscapeChars and prefix the dash with a backslash, as in:

fnr.exe" --cl --dir "D:\animals" --fileMask "animals.txt" --useEscapeChars --find "rats" --replace "-bugs"
  • this does not help me when "-bugs" could be "nematods" and a "\nematods" will insert a new line.
WORKAROUND 2: my document doaes not contain ";", so I first replace prefixing with ";" then remove the ";"
--find "rats" --replace ";-bugs"
--find ";" --replace ""