Parameter for suppressing all quotes in the given area instead of %Q

Here you can propose new features, make suggestions etc.

Moderators: petermad, Stefan2, Hacker

Post Reply
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Parameter for suppressing all quotes in the given area instead of %Q

Post by *Fla$her »

My old request was not fully understood by the author, as a result, %Q does not suppress quotes for some parameters like %An.
Since the correction of the original parameter was refused, I proposed a new parameter that will do what is needed without having to handle each parameter individually.

There are two simple solutions:
  1. %q will have two states, toggling double quote suppression:

    %N = "name 1.ext"
    %A1 = "any text 1"
    %A2 = "any text 2"
    %|$CLIPNAME_NE1| = get "this" text

    prog.exe /switch1 "%q-par1='%N' -par2='%A1'%q" /switch2 "%q-par3='%A2' -par4='%|$CLIPNAME_NE1|'%q"

    This entry will give the following result:

    Code: Select all

    prog.exe /switch1 "-par1='name 1.ext' -par2='any text 1'" /switch2 "-par3='any text 2' -par4='get this text'"
  2. There will be one parameter, and the boundaries of the suppression area will be some symbol prohibited in names, for example a slash.

    The same result will be given by such an entry:
    prog.exe /switch1 "%q/-par1='%N' -par2='%A1'/" /switch2 "%q/-par3='%A2' -par4='%|$CLIPNAME_NE1|'/"
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *ghisler(Author) »

My old request was not fully understood by the author, as a result, %Q does not suppress quotes for some parameters like %An.
Your request about removing quotes was fully understood, but it has nothing to do with %Q, which only turns off automatic adding of quotes.
%N itself does not contain any quotes, at least not in the Windows file system.
%A is a command line received from elsewhere, so it may or may not contain quotes.
Your suggestion with slashes is way too complex. I will just use %q as a toggle: The first %q will remove all quotes from parameters %A1, %A2 etc., the second will keep them, the third will again remove them etc.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *Fla$her »

Your request about removing quotes was fully understood, but it has nothing to do with %Q
I wrote "old". It has a direct relation to this:
Fla$her wrote: 2022-06-20, 15:05 UTC There are situations in which you need to output quotes not at the ends of the path, but in the context of the parameter in which they are included.

For example:

CommandParameters
cmd /v /cset "p=%P%N"
TCFS2 /ef"tcd(,<`%V`>,S)"
etc
%N itself does not contain any quotes, at least not in the Windows file system.
%A is a command line received from elsewhere, so it may or may not contain quotes.
The last thesis is also true in relation to %N.
I will just use %q as a toggle:
Good. Thank you!
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *ghisler(Author) »

I have just sent you a private beta (to your forum mail address) where I added this function, please try it!
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *Fla$her »

No matter how hard I tried to convey my position to the author, I couldn't get a complete solution, unfortunately.
28.04.26 Added: Internal command parameter %q (lowercase): Remove all double quotes from parameters %A1, %A2 etc. and %|envvar| (32/64)
Although, of course, this is better than nothing...
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 6941
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *white »

Fla$her wrote: 2026-05-09, 19:35 UTC No matter how hard I tried to convey my position to the author, I couldn't get a complete solution, unfortunately.
Do you mean privately or on the forum?
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *Fla$her »

Privately, during testing before publication.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *ghisler(Author) »

2Fla$her
You complained that you had to use a combination of %Q and %q. They are for completely different things (auto-adding quotes vs. removing quotes), so I do NOT want to combine them.
Can you give me a single example where you can't achieve what you need with these two?
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for suppressing all quotes in the given area instead of %Q

Post by *Fla$her »

2ghisler(Author)
I complained that %q was not implemented as requested when all double quotes in a given area are suppressed.
I've also complained that %q%Q looks like an aesthetically bad solution for a programmer.
I've given examples where this bad solution won't work primarily where %Q is only needed in a certain area, i.e., before specifying other parameters.
If I create a \\\Virtual Panel\Project "Blue Book" folder, then neither %Q%q%N %S1 will cause double quotes to be suppressed when I need to create a pseudo-duplicate in other panel.
I also provided my suggestion, where %Q should work as a switch by analogy with %q.
It's also possible that other parameters may appear for which both options will not work, because they are tied to specific parameters and not to the area.
Overquoting is evil! 👎
Post Reply