Use environment variables in the `Search for` field

Here you can propose new features, make suggestions etc.

Moderators: Stefan2, Hacker, petermad

Post Reply
andry81
Member
Member
Posts: 180
Joined: 2018-11-22, 19:17 UTC

Use environment variables in the `Search for` field

Post by *andry81 »

I want to move a default directory exclude list to an environment variable to use it everywhere including from the TC:

Code: Select all

DEFAULT_EXCLUDE_DIRS="~*" ".git" ".svn" ".hg" ".log" ".temp" "_ext" "_externals" "ext" "_out" "out" "Output" "*.backup" "*.bak" "*.old" ".vs" "__pycache__"
The reason is to use the variable from different scripts like .bat, .sh, etc

But now it starts to interfere with the TC, because currently it is inlined as a raw text into `wincmd.ini`:

Code: Select all

blabla_to_search_SearchFor=*.*|~*\ .git\ .svn\ .hg\ .log\ .temp\ _ext\ _externals\ ext\ _out\ out\ Output\ *.backup\ *.bak\ *.old\ .vs\ Debug\ Release\ RelWithDebInfo\ MinSizeRel\ __pycache__\
blabla_to_search_SearchFlags=0|003002010021|||||||||0000|||
This is not good, because is a duplication.

I want something like this:

Code: Select all

blabla_to_search_SearchFor=*.*|%|DEFAULT_EXCLUDE_DIRS| Debug\ Release\ RelWithDebInfo\ MinSizeRel\
Additionally, would be better to have an expression syntax to post process the text in each item in the list. For example, if a variable ends by `DIRS` or `FILES` or `PATHS` or `LIST`, then something like this will append to the end of each element in the list (including double quotes reapply):

Code: Select all

blabla_to_search_SearchFor=*.*|%|DEFAULT_EXCLUDE_DIRS:%(.suffix)="\",%(.prefix)="*\"| Debug\ Release\ RelWithDebInfo\ MinSizeRel\
, where `%(.suffix)` and `%(.prefix)` - parameters to an expression or something like that and the `%|env|` expression expands to:

Code: Select all

"*\~*\" "*\.git\" "*\.svn\" "*\.hg\" "*\.log\" "*\.temp\" "*\_ext\" "*\_externals\" "*\ext\" "*\_out\" "*\out\" "*\Output\" "*\*.backup\" "*\*.bak\" "*\*.old\" "*\.vs\" "*\__pycache__\"
This is necessary due to use from different scripts, Unix shell, Windows Batch, etc. Where the list has to be without any suffixes or prefixes.

Is there a way to use it or may be implement?
Post Reply