From 156b3e3fdd6f1947dc7a8dc057c67361d3672f8e Mon Sep 17 00:00:00 2001 From: "Steffen (Daode) Nurpmeso" Date: Fri, 7 Apr 2017 18:05:52 +0200 Subject: [PATCH] cc-test.sh, nail.1: add simple test for -e, -H and -L; improve doc --- cc-test.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ nail.1 | 69 +++++++++++++++++++++++------------------------------- 2 files changed, 107 insertions(+), 40 deletions(-) diff --git a/cc-test.sh b/cc-test.sh index 07d039c0..186fea00 100755 --- a/cc-test.sh +++ b/cc-test.sh @@ -209,6 +209,7 @@ t_behave() { have_feat smime && t_behave_smime + t_behave_e_H_L_opts t_behave_compose_hooks } @@ -1846,6 +1847,83 @@ t_behave_vexpr() { fi } +t_behave_e_H_L_opts() { + TRAP_EXIT_ADDONS="./.tsendmail.sh ./.t.mbox" + + touch ./.t.mbox + "${SNAIL}" ${ARGS} -ef ./.t.mbox + echo ${?} > "${MBOX}" + + ${cat} <<-_EOT > ./.tsendmail.sh + #!/bin/sh - + (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo + ) >> "./.t.mbox" + _EOT + chmod 0755 ./.tsendmail.sh + printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' | + "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh + printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' | + "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh + + "${SNAIL}" ${ARGS} -ef ./.t.mbox + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -efL @t@me ./.t.mbox + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -efL @t@you ./.t.mbox + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -efL '@>@Line 1' ./.t.mbox + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -efL '@>@Hello.' ./.t.mbox + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -efL '@>@Bye.' ./.t.mbox + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -efL '@>@Good bye.' ./.t.mbox + echo ${?} >> "${MBOX}" + + "${SNAIL}" ${ARGS} -fH ./.t.mbox >> "${MBOX}" + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" + echo ${?} >> "${MBOX}" + "${SNAIL}" ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null + echo ${?} >> "${MBOX}" + + ${rm} -f ${TRAP_EXIT_ADDONS} + TRAP_EXIT_ADDONS= + +#1 +#0 +#0 +#0 +#0 +#0 +#0 +#1 +#>N 1 Alchemilla 1996-10-02 01:50 7/112 +# N 2 Alchemilla 1996-10-02 01:50 7/111 +#0 +#>N 1 Alchemilla 1996-10-02 01:50 7/112 +#0 +# N 2 Alchemilla 1996-10-02 01:50 7/111 +#0 +#>N 1 Alchemilla 1996-10-02 01:50 7/112 +# N 2 Alchemilla 1996-10-02 01:50 7/111 +#0 +#>N 1 Alchemilla 1996-10-02 01:50 7/112 +#0 +# N 2 Alchemilla 1996-10-02 01:50 7/111 +#0 +#0 + cksum_test behave:e_H_L_opts "${MBOX}" '1708955574 678' +} + t_behave_compose_hooks() { TRAP_EXIT_ADDONS="./.tsendmail.sh ./.tnotes" diff --git a/nail.1 b/nail.1 index 425105e5..37d63c3f 100644 --- a/nail.1 +++ b/nail.1 @@ -303,8 +303,10 @@ This command line option is \*(OB. . .Mx .It Fl e -Just check if mail is present (in the specified or system -.Va inbox ) : +Just check if mail is present (in the system +.Va inbox +or the one specified via +.Fl f ) : if yes, return an exit status of zero, a non-zero value otherwise. To restrict the set of mails to consider in this evaluation a message specification can be added with the option @@ -346,21 +348,15 @@ that starts with a hyphen-minus, prefix with a relative path, as in . .Mx .It Fl H -Display a summary of the +Display a summary of .Ic headers -of all messages in the specified mailbox or system -.Va inbox -and exit. -A configurable summary view is available via the +and exit; a configurable summary view is available via the .Fl L option. . .Mx .It Fl h Show a short usage summary. -Because of widespread use a -.Fl Fl help -argument will have the same effect. . .Mx .It Fl i @@ -369,13 +365,11 @@ argument will have the same effect. to ignore tty interrupt signals. . .Mx -.It Fl L Ar spec-list -Display a summary of all +.It Fl L Ar spec +Display a summary of .Ic headers -of only those messages in the specified mailbox or the system -.Va inbox -that match the given -.Ar spec-list , +of all messages that match the given +.Ar spec , then exit. See the section .Sx "Specifying messages" @@ -931,8 +925,10 @@ account credentials, the variable chains, and accessing protocol-specific resources, the section .Sx "Character sets" -goes into the details of character encoding and how to use them for -representing messages and MIME part contents by specifying them in +goes into the details of character encodings, and how to use them for +interpreting the input data given in +.Va ttycharset +and representing messages and MIME part contents in .Va sendcharsets , and reading the section .Sx "The mime.types files" @@ -1539,9 +1535,9 @@ mechanisms that are controlled by the locale setting (the manual for .Xr setlocale 3 -should give an overview); the \*(UA internal variable +should give an overview): the \*(UA internal variable .Va ttycharset -will be set to the detected terminal character set accordingly +will be set to the detected terminal character set accordingly, and will thus show up in the output of the commands .Ic set and @@ -1550,27 +1546,18 @@ and .Pp However, a user supplied .Va ttycharset -value is not overwritten by this detection mechanism: this -.Dq feature -must be used if the detection does not work properly, -and it may be used to adjust the name of the locale character set. -E.g., on BSD systems one may use a locale with the character set -ISO8859-1, which is not a valid name for this character set; to be on -the safe side, one may set -.Va ttycharset -to the correct name, which is ISO-8859-1. -. -.Pp -Note that changing the value does not mean much beside that, -since several aspects of the real character set are implied by the -locale environment of the system, -and that stays unaffected by the content of an overwritten -.Va ttycharset -variable. -(This is mostly an issue when interactively using \*(UA, though. -It is actually possible to send mail in a completely +value is not overwritten by this detection mechanism. +I.e., it is actually possible to send mail in a completely .Dq faked -locale environment, an option that \*(UA's test-suite uses excessively.) +locale environment, an option which can be used to generate and send, +e.g., UTF-8 input data in a +.Ql LC_ALL=C +environment (an example of this can be found in the section +.Sx "On sending mail, and non-interactive mode" ) . +Changing the value does not mean much beside that, because several +aspects of the real character set are implied by the locale environment +of the system, which stays unaffected by +.Va ttycharset . . .Pp If no character set conversion capabilities have been compiled into @@ -10440,6 +10427,7 @@ Queried and used once on program startup, actively managed for child processes and the MLE (see .Sx "On terminal control and line editor" ) in interactive mode thereafter. +Ignored in non-interactive mode, which always uses 80 columns. . .Mx .It Ev DEAD @@ -10488,6 +10476,7 @@ The user's preferred number of lines on a page or the vertical screen or window size in lines. Queried and used once on program startup, actively managed for child processes in interactive mode thereafter. +Ignored in non-interactive mode, which always uses 24 lines. . .Mx .It Ev LISTER -- 2.11.4.GIT