Genivia/ugrep-indexer

Parameter "-X" doesn't work at all

Closed this issue · 4 comments

Hi,
I'm playing with ugrep (-indexer) and I noticed that option "-X" doesn't work. Option "--ignore-files" works as documented:

$ nice ugrep-indexer -9 -z --ignore-files=.gitignore

> index accuracy: 9 (3%~10% noise)
> decompress:     yes (zmax=1)
> ignore binary:  no
> ignore files:   ".gitignore"
> index hidden:   no


   2151816032 bytes scanned and indexed with 67% noise on average
        51599 files indexed in 5 directories
            1 new directories indexed
           15 new files indexed
           40 modified files indexed
            0 deleted files removed from indexes
          174 binary files indexed
            0 binary files ignored with --ignore-binary
            5 directories ignored with --ignore-files
            0 files ignored with --ignore-files
            0 symbolic links skipped
            0 devices skipped
       918435 bytes indexing storage increase at 17 bytes/file

Indexes are fresh and up to date

and with -X

$ nice ugrep-indexer -9 -z -X .gitignore

> index accuracy: 9 (3%~10% noise)
> decompress:     yes (zmax=1)
> ignore binary:  no
> ignore files:   ".gitignore"
> index hidden:   no

ugrep-indexer: error: cannot open directory .gitignore: Not a directory
ugrep-indexer: error: cannot create index file in .gitignore: Not a directory

            0 files indexed in 0 directories
            1 new directories indexed
            0 new files indexed
            0 modified files indexed
            0 deleted files removed from indexes
            0 binary files indexed
            0 binary files ignored with --ignore-binary
            0 directories ignored with --ignore-files
            0 files ignored with --ignore-files
            0 symbolic links skipped
            0 devices skipped
            2 warnings
            0 bytes indexing storage decrease

Indexes are fresh and up to date

Option -X does not accept an argument, it only assumes the default .gitignore is used.

An optional FILE argument can be specified with the --ignore-files long option using the = sign. The short -X option is the same as --ignore-files but does not accept a FILE argument. If we want to change -X to accept a FILE argument then -X must always accept a FILE argument (which I don't prefer). We could do a -X=FILE, but that is not a standard convention.

Thank you for explanation.

Thanks for reporting, since questions like these help to improve the help pages. I've updated the help and man pages to make it more clear that -X does not take an argument.