1

I'm using Silver Searcher, ag, version 2.1.0 on Ubuntu. I'm trying to search for the string aStar in Haskell files in the current directory tree. (The files are text files with extension .hs.)

The behaviour isn't what I expect.

$ ag aStar

finds no matches.

ag --haskell aStar

finds no matches.

ag --haskell --all-text aStar

finds the correct matches in the .hs files.

ag --all-text aStar

finds the correct matches in .hs files, plus a bunch in some temporary files I don't want searched.

Any suggestions on what I'm doing wrong, and why the --haskell flag doesn't make ag search the Haskell files?

Neil Smith
  • 111
  • 1
  • `ag aStar` works for me. Can you put contents of your `.hs` files? – Arkadiusz Drabczyk Jan 01 '20 at 18:37
  • Further investigation shows it's the _path_ that's important. The files I'm after are in `advent18/src/advent18.hs` and aren't found. But if I `cd advent18` first, the files are found in the relative `./src/` directory. It seems the `--all-text` flag is making `ag` search deeper in the tree. – Neil Smith Jan 02 '20 at 08:51

0 Answers0