* make the output of mu cfind/extract/view locale-encoded except for cfind
with --format=bbdb
This commit is contained in:
@ -298,28 +298,31 @@ save_parts (const char *path, const char *filename, MuConfig *opts)
|
||||
|
||||
|
||||
|
||||
#define color_maybe(C,COND) ((COND)?(C):"")
|
||||
#define color_maybe(C) do{ if (color) fputs ((C),stdout);}while(0)
|
||||
|
||||
static void
|
||||
each_part_show (MuMsg *msg, MuMsgPart *part, gboolean color)
|
||||
{
|
||||
g_print (" %u %s%s %s%s/%s%s [%s%s%s]\n",
|
||||
part->index,
|
||||
/* filename */
|
||||
color_maybe (MU_COLOR_GREEN, color),
|
||||
part->file_name ? part->file_name : "<none>",
|
||||
/* index */
|
||||
g_print (" %u ", part->index);
|
||||
|
||||
/* content type */
|
||||
color_maybe (MU_COLOR_BLUE, color),
|
||||
part->type ? part->type : "",
|
||||
part->subtype ? part->subtype : "",
|
||||
color_maybe (MU_COLOR_DEFAULT, color),
|
||||
|
||||
/* disposition */
|
||||
color_maybe (MU_COLOR_MAGENTA, color),
|
||||
part->disposition ? part->disposition : "<none>",
|
||||
color_maybe (MU_COLOR_DEFAULT, color)
|
||||
);
|
||||
/* filename */
|
||||
color_maybe (MU_COLOR_GREEN);
|
||||
mu_util_fputs_encoded (part->file_name ? part->file_name : "<none>",
|
||||
stdout);
|
||||
/* content-type */
|
||||
color_maybe (MU_COLOR_BLUE);
|
||||
mu_util_print_encoded (
|
||||
" %s/%s ",
|
||||
part->type ? part->type : "<none>",
|
||||
part->subtype ? part->subtype : "<none>");
|
||||
|
||||
/* disposition */
|
||||
color_maybe (MU_COLOR_MAGENTA);
|
||||
mu_util_print_encoded (
|
||||
"[%s]", part->disposition ? part->disposition : "<none>");
|
||||
color_maybe (MU_COLOR_DEFAULT);
|
||||
fputs ("\n", stdout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user