avoid quoting spaces in git-annex find output to terminal
That's too much quoting, the user expects the filename to be copy and pasteable. It would be ok to slash-escape space ('\ ') which is what gnu find does, but it doesn't seem necessary either. ${escaped_file} has always quoted spaces though, so keep on doing it there. Sponsored-by: Nicholas Golder-Manning on Patreon
This commit is contained in:
parent
4358545a3e
commit
4d6c918eff
5 changed files with 6 additions and 6 deletions
|
@ -10,7 +10,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
|
|||
control characters are only filtered out when displaying to the
|
||||
terminal.
|
||||
* find, findkeys, examinekey: When outputting to a terminal and --format
|
||||
is not used, quote unusual characters.
|
||||
is not used, quote control characters. Output to a pipe is unchanged.
|
||||
(Similar to the behavior of GNU find.)
|
||||
* addurl --preserve-filename now rejects filenames that contain other
|
||||
control characters, besides the escape sequences it already rejected.
|
||||
|
|
|
@ -105,7 +105,7 @@ showFormatted (IsTerminal isterminal) format unformatted vars =
|
|||
case format of
|
||||
Nothing -> do
|
||||
liftIO $ S8.putStrLn $ if isterminal
|
||||
then Utility.Format.escapedFormat unformatted
|
||||
then Utility.Format.encode_c (const False) unformatted
|
||||
else unformatted
|
||||
Just formatter -> liftIO $ putStr $
|
||||
Utility.Format.format formatter $
|
||||
|
|
|
@ -35,7 +35,7 @@ that can be determined purely by looking at the key.
|
|||
Also, '\\n' is a newline, '\\000' is a NULL, etc.
|
||||
|
||||
The default output format is the same as `--format='${escapedkey}\\n'`
|
||||
when outputting to the terminal, and otherwise `--format='${key}\\n'`
|
||||
except when outputting to a terminal, control characters will be escaped.
|
||||
|
||||
* `--json`
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ finds files in the current directory and its subdirectories.
|
|||
|
||||
Also, '\\n' is a newline, '\\000' is a NULL, etc.
|
||||
|
||||
The default output format is the same as `--format='${escaped_file}\\n'`
|
||||
when outputting to the terminal, and otherwise `--format='${file}\\n'`
|
||||
The default output format is the same as `--format='${file}\\n'`,
|
||||
except when outputting to a terminal, control characters will be escaped.
|
||||
|
||||
* `--json`
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ Outputs a list of keys known to git-annex.
|
|||
Also, '\\n' is a newline, '\\000' is a NULL, etc.
|
||||
|
||||
The default output format is the same as `--format='${escapedkey}\\n'`
|
||||
when outputting to the terminal, and otherwise `--format='${key}\\n'`
|
||||
except when outputting to a terminal, control characters will be escaped.
|
||||
|
||||
* `--json`
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue