#851 Find in Files doesn't accept option --include

v1.22
closed-fixed
Interface (176)
5
2012-09-17
2012-04-10
Geert
No

If I do a recursive "Find in Files" and specify the extra option --include "*.[ch]" the search always comes up empty. If I leave out the option the search finds the documents containing my search term.

If I repeat the search on the command line using grep and the options that geany shows me, then grep does find the files I want (C and H-files):
$ grep -nHlifr --include "*.[ch]" -- abcd *

I tried different formats for --include: "*.[ch]", '*.[ch]' and \*.\[ch\]
They all don't work with geany but they do work on the commandline.

I'm using geany 0.19.1 "Vellam" and GNU grep 2.6.3 on Debian Squeeze 2.6.32-5-amd64.

Discussion

  • This is because the extra options weren't parsed as a shell expression but simply as a whitespace-separated list of arguments, thus leading to give grep the raw "*.[ch]" pattern, with the quotes. This is now fixed in Git.

    You can however simply remove the quoting for the command to work as expected. Moreover, you could also simply use the Files filter to set the --include option for you, e.g. "*.c *.h", see the manual for details.

     
    • assigned_to: nobody --> colombanw
    • status: open --> closed-fixed
     
  • Geert
    Geert
    2012-04-10

    Thanks for that. Leaving out the quotes works :-)

    I can't find the "Files filter" you mention. The manual has only an entry for "Filtering out version control files".
    I'm looking at: http://www.geany.org/manual/current/index.html

    Could this be a plugin?

     
    • milestone: --> v1.22