[DONE] ES: double quote filenames/paths

Have a suggestion for "Everything"? Please post it here.
Post Reply
NotNull
Posts: 2286
Joined: Wed May 24, 2017 9:22 pm

[DONE] ES: double quote filenames/paths

Post by NotNull » Mon Oct 14, 2019 7:47 pm

I can not find a way to make ES report filenames and folders in double quotes.
That can of course be added when "post-processing" the results in a script, but an option for that would be welcome.


Alternative:
The -csv option will report filenames in "", but adds a header-line. A -no-header option or similar would do fine too.
Maybe even more useful: that way you can combine multiple queries in 1 EFU/CSV/..
( like es.exe query1 -efu > output.efu followed by es.exe query2 -efu -no-header >> output.efu)
Last edited by NotNull on Wed Oct 23, 2019 4:22 pm, edited 1 time in total.

void
Site Admin
Posts: 5654
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES: double quote filenames/paths

Post by void » Tue Oct 15, 2019 7:41 am

ES 1.1.0.16
  • Added -no-header command line option
  • Added -double_quote -double-quote command line option
  • Added -version command line option
  • Added -get-everything-version command line option
ES-1.1.0.16.zip

-no-header
Do not output a column header for CSV and EFU files.
-double-quote
Wrap paths and filenames with double quotes.
-version
Display ES major.minor.revision.build version and exit.
-get-everything-version
Display Everything major.minor.revision.build version and exit.

NotNull
Posts: 2286
Joined: Wed May 24, 2017 9:22 pm

Re: ES: double quote filenames/paths

Post by NotNull » Tue Oct 15, 2019 4:28 pm

:shock: That's quick!
void wrote:
Tue Oct 15, 2019 7:41 am
  • Added -no-header command line option
  • Added -double_quote command line option
Works like a charm!
BTW: -double_quote should be -double-quote

  • Added -version command line option
  • Added -get-everything-version command line option
Are you clairvoyant? :o Both were on my list of "ask later suggestions". I had even written the code to compare versions already ...

With that new options, you can check for - for example - the Everything version like this:

PowerShell

Code: Select all

if ([Version](es.exe -get-everything-version) -lt [Version]"1.4.1.934") {echo Everything version too old}
CMD
CMD doesn't have some embedded version comparison functionality, so one has to write it.

Note1: this is made specifically for Everything /ES : Always x.x.x.x numbering (only numbers) and no prefix zero's (like 1.05.01.123).
If Everything versioning scheme ever changes, this code has to change too.

Note2: Script uses Major Minor Build Revision version scheme, whereas these options use Major Minor Revision Build scheme. Doesn't matter for the outcome; end result will be the same.

Code: Select all

@echo off
setlocal enabledelayedexpansion

::	Check against version ...
	set REFERENCE=1.4.1.877

::	INIT
	set CHECK=0.0.0.0
	set RESULT=

::__________________________________________________
::
::			ACTION!
::__________________________________________________
::
:: Split REFERENCE version in Major Minor Build Revision
	for /f "tokens=1-4 delims=." %%i in ("%REFERENCE%") do (
		set /a REFERENCE[0]=%%i, REFERENCE[1]=%%j, REFERENCE[2]=%%k, REFERENCE[3]=%%l
	)

:: Get current version (%CHECK%)
	for /f "usebackq delims=" %%x in (`es.exe -get-everything-version`) DO set CHECK=%%x

	
:: Split CHECK version in Major Minor Build Revision
	for /f "tokens=1-4 delims=." %%i in ("%CHECK%") do (
		set /a CHECK[0]=%%i, CHECK[1]=%%j, CHECK[2]=%%k, CHECK[3]=%%l
	)

::	Compare each part (if needed)
	for /l %%i in (0,1,3) do call :COMPARE !REFERENCE[%%i]! !CHECK[%%i]!

	if not defined RESULT set RESULT=same version
	echo %COMPARE% is a %RESULT% than %REFERENCE%
goto :EOF

::___________________________________________________
::
			:COMPARE     [REFERENCE[n] CHECK[n]
::___________________________________________________
::
	if defined RESULT goto :EOF
	if %1  gtr %2 set RESULT=older version
	if %1  lss %2 set RESULT=newer version
goto :EOF


void
Site Admin
Posts: 5654
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES: double quote filenames/paths

Post by void » Fri Oct 18, 2019 5:51 am

BTW: -double_quote should be -double-quote
Fixed, thanks.
Are you clairvoyant? :o Both were on my list of "ask later suggestions". I had even written the code to compare versions already ...
I had these on my TODO list for some time now.
Would it be helpful to add -version-major, -version-minor, -version-revision and -version-build?
This might make comparison easier, you could just use the build number.
Same with -get-everything-version-major, -get-everything-version-minor...

NotNull
Posts: 2286
Joined: Wed May 24, 2017 9:22 pm

Re: ES: double quote filenames/paths

Post by NotNull » Fri Oct 18, 2019 7:26 pm

void wrote:
Fri Oct 18, 2019 5:51 am
Would it be helpful to add -version-major, -version-minor, -version-revision and -version-build?
This might make comparison easier, you could just use the build number.
Same with -get-everything-version-major, -get-everything-version-minor...
Not as far as I am concerned. I saw these in the SDK when "researching" this version stuff. Thought about it and concluded that it wasn't worth the trouble (it can easily be deducted from the complete version).

If anything, something like -require-everything-version 1.4.1.877 -minimum-everything-version 1.4.1.877 and -require-es-version 1.1.0.11 -minimum-version 1.1.0.11 would be more practical.
On the other hand: the only time I really needed to check for the version, was when you implemented the -getresultcount fix in build 947.


Long story short: I'm good :) Very happy with the current state of ES. (it has grown into being one of my favourite tools)

Post Reply