Preprocessor functions passed from the command line are not well expanded since 1384a

Discussion related to "Everything" 1.5 Alpha.
Post Reply
bit
Posts: 42
Joined: Fri Feb 17, 2023 8:57 am

Preprocessor functions passed from the command line are not well expanded since 1384a

Post by bit »

Problem still exists in 1387a.

this works:

Code: Select all

Everything64.exe -newtab -s  size:[getsize:"C:\Windows\Explorer.exe"] 
this is boken:

Code: Select all

Everything64.exe -newtab -s  size:[getsize:"C:\Windows\Explorer.exe"]   [getproperty:"C:\Windows\Explorer.exe",extension]
get:
"C:\Program Files\Everything 1.5a\exe" size:5550856
other broken examples:

Code: Select all

 .\Everything64.exe -newtab -s  ^< aaa^|bbb ^>

Everything64.exe  -newtab -s  video: length:#format-duration:[get-property:"C:\test\Photos\IMG_0315.MOV",length] 
 
bit
Posts: 42
Joined: Fri Feb 17, 2023 8:57 am

Re: Preprocessor functions passed from the command line are not well expanded since 1384a

Post by bit »

Did some research here and found the solutions:

After quoting all spaces, now working:

Code: Select all

.\Everything64.exe -newtab -s  size:[getsize:"C:\Windows\Explorer.exe"]" "[getproperty:"C:\Windows\Explorer.exe",extension]
and should not mixing different writing styles of functions, they are not being expanded at the same time , quoted from Search Preprocessor
function: and [function:] are "termprocessors" - Search operators in the output are escaped.
#function: is "preprocessor" - Search operators in the output are processed.
Preprocessor is applied first, then the termprocessor for each search term.
the following styles now both work:

Code: Select all

Everything64.exe  -newtab -s  video:" "length:[format-duration:[get-property:"C:\Users\User\Pictures\iCloud Photos\Photos\IMG_0315.MOV",length]] 
Everything64.exe  -newtab -s  video:" "length:#format-duration:#get-property:^<"C:\Users\User\Pictures\iCloud Photos\Photos\IMG_0315.MOV",length^>

 
So no real bug here, but my old scripts need to be updated to match the correct syntax.

By the way, I can't remember from where I learned the #function:<arg1,arg2> syntax. Don't find it from Search Preprocessor too.
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preprocessor functions passed from the command line are not well expanded since 1384a

Post by void »

#function:<arg1,arg2> syntax was available in the first preprocessor implementation.

It is still supported, but no longer documented.
I will try to enforce the [function:...] syntax moving forward as it is cleaner and easier and pass around on the command line.
Post Reply