[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: quoting of strings in errors
From: |
Pádraig Brady |
Subject: |
Re: quoting of strings in errors |
Date: |
Sat, 31 Oct 2015 01:39:24 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 28/10/15 18:19, Jim Meyering wrote:
> On Wed, Oct 28, 2015 at 10:30 AM, Pádraig Brady <address@hidden> wrote:
>> On 28/10/15 17:01, Jim Meyering wrote:
>>> On Wed, Oct 28, 2015 at 6:18 AM, Pádraig Brady <address@hidden> wrote:
>>>> seq 10 | shuf --random-source="blah"$'\r'
>>>
>>> Thank you for pursuing this.
>>> Properly quoting unusual names like those is definitely welcome,
>>
>> Cool. At least with this patch, the quoting is consistent across all utils.
>> I.E. we were already using quote() in most places.
>>
>>> however, in the remaining 99% of use cases, I find the added quotes
>>> to be most unwelcome: at least two extra bytes per line, in addition to
>>> the common hassles with multi-byte rendering.
>>>
>>> What do you think about a mode that quotes only when necessary?
>>
>> What about distinguishing file names which account for many of these?
>> I.E. have quote_name() use "shell-escaped" quoting by default,
>> which would mean easier copy and pasting?
>
> I like it.
gnulib part attached.
The coreutils part to call into this will be something like:
#define quotef(arg) quotearg_style (shell_escape_quoting_style, arg)
It will also be automatically available to `ls --quoting-style=shell-escape`
which is useful to give a concise and unambiguous presentation of file names.
cheers,
Pádraig.
gnulib-quote-shell-escape.patch
Description: Text Data