mirror of https://github.com/djcb/mu.git
mu: improve mu verify output, update man page
This commit is contained in:
parent
0041cd47ef
commit
2d75b3d3ec
|
@ -1,4 +1,4 @@
|
||||||
.TH MU VERIFY 1 "September 2012" "User Manuals"
|
.TH MU VERIFY 1 "June 2015" "User Manuals"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ attempt to find keys online (see the \fBauto-key-retrieve\fR option in the
|
||||||
|
|
||||||
To display aggregated (one-line) information about the signatures in a message:
|
To display aggregated (one-line) information about the signatures in a message:
|
||||||
.nf
|
.nf
|
||||||
$ mu verify --verbose msgfile
|
$ mu verify msgfile
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
To display information about all the signatures:
|
To display information about all the signatures:
|
||||||
|
|
18
mu/mu-cmd.c
18
mu/mu-cmd.c
|
@ -436,38 +436,40 @@ each_sig (MuMsg *msg, MuMsgPart *part, VData *vdata)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_verdict (VData *vdata, gboolean color)
|
print_verdict (VData *vdata, gboolean color, gboolean verbose)
|
||||||
{
|
{
|
||||||
g_print ("verdict: ");
|
g_print ("verdict: ");
|
||||||
|
|
||||||
switch (vdata->combined_status) {
|
switch (vdata->combined_status) {
|
||||||
case MU_MSG_PART_SIG_STATUS_UNSIGNED:
|
case MU_MSG_PART_SIG_STATUS_UNSIGNED:
|
||||||
g_print ("%s", "no signature found");
|
g_print ("no signature found");
|
||||||
break;
|
break;
|
||||||
case MU_MSG_PART_SIG_STATUS_GOOD:
|
case MU_MSG_PART_SIG_STATUS_GOOD:
|
||||||
color_maybe (MU_COLOR_GREEN);
|
color_maybe (MU_COLOR_GREEN);
|
||||||
g_print ("%s", "signature(s) verified");
|
g_print ("signature(s) verified");
|
||||||
break;
|
break;
|
||||||
case MU_MSG_PART_SIG_STATUS_BAD:
|
case MU_MSG_PART_SIG_STATUS_BAD:
|
||||||
color_maybe (MU_COLOR_RED);
|
color_maybe (MU_COLOR_RED);
|
||||||
g_print ("%s", "bad signature");
|
g_print ("bad signature");
|
||||||
break;
|
break;
|
||||||
case MU_MSG_PART_SIG_STATUS_ERROR:
|
case MU_MSG_PART_SIG_STATUS_ERROR:
|
||||||
color_maybe (MU_COLOR_RED);
|
color_maybe (MU_COLOR_RED);
|
||||||
g_print ("%s", "verification failed");
|
g_print ("verification failed");
|
||||||
break;
|
break;
|
||||||
case MU_MSG_PART_SIG_STATUS_FAIL:
|
case MU_MSG_PART_SIG_STATUS_FAIL:
|
||||||
color_maybe(MU_COLOR_RED);
|
color_maybe(MU_COLOR_RED);
|
||||||
g_print ("%s", "error in verification process");
|
g_print ("error in verification process");
|
||||||
break;
|
break;
|
||||||
default: g_return_if_reached ();
|
default: g_return_if_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
color_maybe (MU_COLOR_DEFAULT);
|
color_maybe (MU_COLOR_DEFAULT);
|
||||||
if (vdata->report)
|
if (vdata->report && verbose)
|
||||||
g_print ("%s%s\n",
|
g_print ("%s%s\n",
|
||||||
(vdata->oneline) ? ";" : "\n",
|
(vdata->oneline) ? ";" : "\n",
|
||||||
vdata->report);
|
vdata->report);
|
||||||
|
else
|
||||||
|
g_print ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -502,7 +504,7 @@ mu_cmd_verify (MuConfig *opts, GError **err)
|
||||||
(MuMsgPartForeachFunc)each_sig, &vdata);
|
(MuMsgPartForeachFunc)each_sig, &vdata);
|
||||||
|
|
||||||
if (!opts->quiet)
|
if (!opts->quiet)
|
||||||
print_verdict (&vdata, !opts->nocolor);
|
print_verdict (&vdata, !opts->nocolor, opts->verbose);
|
||||||
|
|
||||||
mu_msg_unref (msg);
|
mu_msg_unref (msg);
|
||||||
g_free (vdata.report);
|
g_free (vdata.report);
|
||||||
|
|
Loading…
Reference in New Issue