* make the output of mu cfind/extract/view locale-encoded except for cfind

with --format=bbdb
This commit is contained in:
Dirk-Jan C. Binnema
2011-06-02 11:09:04 +03:00
parent de539ea3f8
commit ccbf76b793
3 changed files with 61 additions and 47 deletions

View File

@ -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);
}