-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --null-output
#614
Add --null-output
#614
Conversation
The That wasn't ideal, but we could have lived with it, because there isn't any input to However, consider the situation if we want NUL-separated output for Adding (Yes, if the user wanted newlines in output but NUL in input, they could do |
We allowed |
39f341e
to
3ec409e
Compare
tar/tarsnap.1-mdoc.in
Outdated
Filenames or patterns are separated by null characters, | ||
not by newlines. | ||
This is often used to read filenames output by the | ||
.Fl print0 | ||
option to | ||
.Xr find 1 . | ||
.It Fl -null-output | ||
(list-archives mode only) | ||
Filenames in output are separated by null characters, not by newlines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Filenames/Archive names/ ?
misc/zsh_completion/_tarsnap
Outdated
@@ -233,6 +233,7 @@ _shtab_tarsnap__list_archives_options=( | |||
"(- : *)"{-h,--help}"[show this help message and exit]" | |||
"-f[specify hash of archive name to operate on (requires --hashes)]:tapehash" | |||
"--hashes[make --list-archives print hashes]" | |||
"--null-output[filenames in output are separated by null characters]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/filenames/archive names/ ?
Fixed because it's true that as of this PR, A later PR will extend that to filenames as well, but we'll change the man page at that time. |
Right, I knew Please clean up the commits and then I'll merge. |
This should have been part of: 2023-08-30 Allow --list-archives --null d21dff3 The --null option was previously used for reading input with -T or -X. When we extended it to apply to --list-archives as well, we were using it to modify the *output* behaviour. That wasn't ideal, but we could have lived with it, because there isn't any input to --list-archives. But suppose that we wanted to allow -T with --list-archives --hashes (i.e. provide a filename which contains hashes which we want to print)? The user would be stuck with either having NUL-separated both input and output, or having newlines for both. Adding --null-output allows the user to have different separators for the input and output. (We can think of "--null" as "--null-input", but we're not renaming "--null" for historical / bsdtar-compatibility reasons.)
These changes were made automatically via scripts.
Rebased, ready for merge. |
No description provided.