[PATCH 1/1] Document tzselect std out redirection
* tzselect.8: Implement this. Signed-off-by: J William Piggott <elseifthen@gmx.com> --- Question: What does the following sentence from this man-page mean? NOTES Applications should not assume that tzselect's output matches the user's political preferences. How can a TZ string define ones political preference? tzselect.8 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tzselect.8 b/tzselect.8 index fb39e1f..19f63bb 100644 --- a/tzselect.8 +++ b/tzselect.8 @@ -19,10 +19,16 @@ tzselect \- select a time zone .SH DESCRIPTION The .B tzselect -program asks the user for information about the current location, -and outputs the resulting time zone description to standard output. +program asks the user for information about a target location, +and outputs the corresponding time zone description to standard output. The output is suitable as a value for the TZ environment variable. .PP +If standard output is redirected to anything other than a terminal, +then the instructions following the confirmation prompt are not printed. +This is to facilitate calling +.B tzselect +from another program. +.PP All interaction with the user is done via standard input and standard error. .SH OPTIONS .TP
J William Piggott wrote:
How can a TZ string define ones political preference?
For example, if you live in Xinjiang, your political preference is related to whether you should use TZ=Asia/Shanghai or TZ=Asia/Urumqi. Both zones are "correct" in some sense for that location. tzselect attempts to avoid political issues, and so won't give you advice about which setting to use. As for documenting the tzselect stderr behavior, I'm mildly inclined to leave the exact output sequence undocumented, as I don't think applications should depend on such implementation details.
On 03/06/2016 04:41 PM, Paul Eggert wrote:
As for documenting the tzselect stderr behavior, I'm mildly inclined to leave the exact output sequence undocumented, as I don't think applications should depend on such implementation details.
Users may also redirect/pipe std out from the command line. It is better to document it, then to ambush users and programmers with unexpected behavior. Especially when changing the long established default behavior, which could impact existing use cases (making it NEWS worthy).
participants (2)
-
J William Piggott -
Paul Eggert