You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the --filter option is disabled in ug.exe and ugrep.exe because I can't simply port the logic directly to Windows. The Unix-based logic creates a pipe and forks a child process to run the filter on the input, with the output sent to the ugrep search engine.
To support --filter in Windows should not be too complicated with an inherited pipe and CreateProcess. There is also the usual wide character API stuff to support in Windows i.e. CreateProcessW, so that non-ASCII filenames are filtered when passed as % to expand the pathname in the filter command arguments.
I will give it a go.
The text was updated successfully, but these errors were encountered:
I also want to update --filter to allow quoted commands and arguments. Quoting will permit arguments with spaces, commas and % to be passed verbatim to the filter command.
The --filter manual page should be updated to reflect this. I try to keep the option description brief, but detailed enough:
--filter=COMMANDS
Filter files through the specified COMMANDS first before searching.
COMMANDS is a comma-separated list of `exts:command arguments',
where `exts' is a comma-separated list of filename extensions and
`command' is a filter utility. Files matching one of `exts' are
filtered. A `*' matches any file. The specified `command' may
include arguments separated by spaces. An argument may be quoted
to include spacing, commas or a `%'. A `%' argument expands into
the pathname to search. For example, --filter='pdf:pdftotext % -'
searches PDF files. The `%' expands into a `-' when searching
standard input. When a `%' is not specified, the filter command
should read from standard input and write to standard output.
Option --label=.ext may be used to specify extension `ext' when
searching standard input. This option may be repeated.
Currently the
--filter
option is disabled in ug.exe and ugrep.exe because I can't simply port the logic directly to Windows. The Unix-based logic creates a pipe and forks a child process to run the filter on the input, with the output sent to the ugrep search engine.To support
--filter
in Windows should not be too complicated with an inherited pipe and CreateProcess. There is also the usual wide character API stuff to support in Windows i.e.CreateProcessW
, so that non-ASCII filenames are filtered when passed as%
to expand the pathname in the filter command arguments.I will give it a go.
The text was updated successfully, but these errors were encountered: