#include "tfcrypt.h"
-tfc_yesno xexit_no_nl;
-
void xerror(tfc_yesno noexit, tfc_yesno noerrno, tfc_yesno nostats, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
- if (statline_was_shown == YES && do_statline_dynamic == YES) tfc_esay("\n");
+ if (noexit == YES && (statline_was_shown == YES && do_statline_dynamic == YES)) tfc_esay("\n");
tfc_nfsay(stderr, "%s: ", tfc_format_pid(progname));
tfc_vfsay(stderr, NO, fmt, ap);
va_end(ap);
if (nostats == NO) {
- print_crypt_status(-1);
- tfc_esay("\n");
+ print_crypt_status(TFC_SIGERR);
}
- xexit_no_nl = YES;
-
_do_sil_exit:
if (noexit == YES) {
errno = 0;
memset(pwdask, 0, sizeof(pwdask));
memset(pwdagain, 0, sizeof(pwdagain));
- if (xexit_no_nl == NO) tfc_esay("\n");
exit(status);
}
{
tfc_yesno is_embedded_prog = NO;
- xexit_no_nl = YES;
-
if (optopt == 'V') {
tfc_say("tfcrypt toolkit, version %s.", _TFCRYPT_VERSION);
if (do_edcrypt != TFC_DO_PLAIN) {
tfc_say(" -v: print number of read and written encrypted bytes, and explain stages.");
tfc_say(" -V seconds: activate timer that will repeatedly print statistics to stderr.");
tfc_say(" -a: shortcut of -O xtime.");
+ tfc_say(" -g: same as '-e -C stream -c rand' or '-d -C stream -c head', depending on mode.");
+ tfc_say(" -j: same as '-e -C ctr -c rand' or '-d -C ctr -c head', depending on mode.");
tfc_say(" -l length: read only these first bytes of source.");
tfc_say(" -r <file>: specify random source instead of /dev/urandom.");
tfc_say(" -R nr_bytes: generate nr_bytes of random bytes suitable for use as key data.");