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?

  • ag aStar works for me. Can you put contents of your .hs files? – Arkadiusz Drabczyk Jan 1 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 2 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.