mirror of https://github.com/djcb/mu.git
* make colorized output the default
- turn of with --nocolor, or by setting MU_NOCOLOR to non-empty
This commit is contained in:
parent
7538f20d60
commit
b563128a4f
|
@ -1,4 +1,4 @@
|
||||||
.TH MU-EASY 1 "December 2011" "User Manuals"
|
.TH MU-EASY 1 "January 2012" "User Manuals"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
||||||
|
@ -19,6 +19,11 @@ that, such as \fBfind\fR), require that you store your mail in the
|
||||||
Maildir-format. If you don't do so, you can still use the other commands, but
|
Maildir-format. If you don't do so, you can still use the other commands, but
|
||||||
you won't be able to index/search your mail.
|
you won't be able to index/search your mail.
|
||||||
|
|
||||||
|
By default, \fBmu\fR uses colorized output when your terminal is capable of
|
||||||
|
doing so. If you don't like color, you can use the \fB--nocolor\fR
|
||||||
|
command-line option, or set the \fBMU_NOCOLOR\fR environment variable to
|
||||||
|
non-empty.
|
||||||
|
|
||||||
.SH INDEXING YOUR E-MAIL
|
.SH INDEXING YOUR E-MAIL
|
||||||
|
|
||||||
Before you can search e-mails, you'll first need to index them:
|
Before you can search e-mails, you'll first need to index them:
|
||||||
|
|
77
man/mu.1
77
man/mu.1
|
@ -1,6 +1,6 @@
|
||||||
.TH MU 1 "May 2011" "User Manuals"
|
.TH MU 1 "January 2012" "User Manuals"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
||||||
mu \- a set of tools to deal with Maildirs and message files, in particular to
|
mu \- a set of tools to deal with Maildirs and message files, in particular to
|
||||||
index and search e-mail messages.
|
index and search e-mail messages.
|
||||||
|
@ -98,14 +98,13 @@ for extract MIME-parts (such as attachments) from messages. See
|
||||||
|
|
||||||
.SH COLORS
|
.SH COLORS
|
||||||
|
|
||||||
Some \fBmu\fR sub-commands support colorized output. By default, this is
|
Some \fBmu\fR sub-commands support colorized output. If you don't want this,
|
||||||
disabled, but you can use the \fI--color\fR/ option to enable it. Even that,
|
you can use the \fI--nocolor\fR/ option to disable it. Even then, colors will
|
||||||
colors will only shown when output goes to a sufficiently capable terminal
|
only shown when output goes to a sufficiently capable terminal (this roughly
|
||||||
(this roughly mirrors the \fI--color=auto\fR of the GNU-version of the
|
mirrors the \fI--color=auto\fR of the GNU-version of the \fBls\fR-command).
|
||||||
\fBls\fR-command).
|
|
||||||
|
|
||||||
Instead of the \fI--color\fR/, you can also set the \fBMU_COLORS\fR
|
Instead of the \fI--color\fR/, you can also set the \fBMU_NOCOLOR\fR
|
||||||
environment variable to non-empty to enable colors.
|
environment variable to non-empty to disable colors.
|
||||||
|
|
||||||
Currently, \fBmu find\fR, \fBmu view\fR, \fBmu cfind\fR and \fBmu extract\fR
|
Currently, \fBmu find\fR, \fBmu view\fR, \fBmu cfind\fR and \fBmu extract\fR
|
||||||
support colors.
|
support colors.
|
||||||
|
@ -184,36 +183,36 @@ The various mu subcommands typically exit with 0 (zero) upon success, and
|
||||||
non-zero when some error occured. The table lists the various error codes.
|
non-zero when some error occured. The table lists the various error codes.
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
exit code | error
|
exit code | error
|
||||||
----------+-------------------------------------------
|
----------+-------------------------------------------
|
||||||
1 | MU_ERROR
|
1 | MU_ERROR
|
||||||
2 | MU_ERROR_IN_PARAMETERS
|
2 | MU_ERROR_IN_PARAMETERS
|
||||||
3 | MU_ERROR_INTERNAL
|
3 | MU_ERROR_INTERNAL
|
||||||
4 | MU_ERROR_NO_MATCHES
|
4 | MU_ERROR_NO_MATCHES
|
||||||
|
|
|
|
||||||
11 | MU_ERROR_XAPIAN
|
11 | MU_ERROR_XAPIAN
|
||||||
|
|
|
|
||||||
13 | MU_ERROR_XAPIAN_QUERY
|
13 | MU_ERROR_XAPIAN_QUERY
|
||||||
14 | MU_ERROR_XAPIAN_DIR_NOT_ACCESSIBLE
|
14 | MU_ERROR_XAPIAN_DIR_NOT_ACCESSIBLE
|
||||||
15 | MU_ERROR_XAPIAN_NOT_UP_TO_DATE
|
15 | MU_ERROR_XAPIAN_NOT_UP_TO_DATE
|
||||||
16 | MU_ERROR_XAPIAN_MISSING_DATA
|
16 | MU_ERROR_XAPIAN_MISSING_DATA
|
||||||
17 | MU_ERROR_XAPIAN_CORRUPTION
|
17 | MU_ERROR_XAPIAN_CORRUPTION
|
||||||
18 | MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK
|
18 | MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK
|
||||||
30 | MU_ERROR_GMIME
|
30 | MU_ERROR_GMIME
|
||||||
|
|
|
|
||||||
50 | MU_ERROR_CONTACTS
|
50 | MU_ERROR_CONTACTS
|
||||||
51 | MU_ERROR_CONTACTS_CANNOT_RETRIEVE
|
51 | MU_ERROR_CONTACTS_CANNOT_RETRIEVE
|
||||||
|
|
|
|
||||||
70 | MU_ERROR_FILE
|
70 | MU_ERROR_FILE
|
||||||
71 | MU_ERROR_FILE_INVALID_NAME
|
71 | MU_ERROR_FILE_INVALID_NAME
|
||||||
72 | MU_ERROR_FILE_CANNOT_LINK
|
72 | MU_ERROR_FILE_CANNOT_LINK
|
||||||
73 | MU_ERROR_FILE_CANNOT_OPEN
|
73 | MU_ERROR_FILE_CANNOT_OPEN
|
||||||
74 | MU_ERROR_FILE_CANNOT_READ
|
74 | MU_ERROR_FILE_CANNOT_READ
|
||||||
75 | MU_ERROR_FILE_CANNOT_CREATE
|
75 | MU_ERROR_FILE_CANNOT_CREATE
|
||||||
76 | MU_ERROR_FILE_CANNOT_MKDIR
|
76 | MU_ERROR_FILE_CANNOT_MKDIR
|
||||||
77 | MU_ERROR_FILE_STAT_FAILED
|
77 | MU_ERROR_FILE_STAT_FAILED
|
||||||
78 | MU_ERROR_FILE_READDIR_FAILED
|
78 | MU_ERROR_FILE_READDIR_FAILED
|
||||||
79 | MU_ERROR_FILE_INVALID_SOURCE
|
79 | MU_ERROR_FILE_INVALID_SOURCE
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
|
@ -235,4 +234,4 @@ Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
.BR mu-view(1)
|
.BR mu-view(1)
|
||||||
.BR mu-extract(1)
|
.BR mu-extract(1)
|
||||||
.BR mu-easy(1)
|
.BR mu-easy(1)
|
||||||
.BR mu-bookmarks(5)
|
.BR mu-bookmarks(5)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2011-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -239,6 +239,6 @@ mu_cmd_cfind (MuConfig *opts, GError **err)
|
||||||
return MU_ERROR_IN_PARAMETERS;
|
return MU_ERROR_IN_PARAMETERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return run_cmd_cfind (opts->params[1], opts->format, opts->color,
|
return run_cmd_cfind (opts->params[1], opts->format,
|
||||||
err);
|
!opts->nocolor, err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2010-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2010-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -345,7 +345,7 @@ show_parts (const char* path, MuConfig *opts, GError **err)
|
||||||
|
|
||||||
mu_msg_part_foreach
|
mu_msg_part_foreach
|
||||||
(msg,(MuMsgPartForeachFunc)each_part_show,
|
(msg,(MuMsgPartForeachFunc)each_part_show,
|
||||||
GUINT_TO_POINTER(opts->color));
|
GUINT_TO_POINTER(!opts->nocolor));
|
||||||
|
|
||||||
mu_msg_unref (msg);
|
mu_msg_unref (msg);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -100,7 +100,7 @@ output_query_results (MuMsgIter *iter, MuConfig *opts, GError **err)
|
||||||
return output_links (iter, opts->linksdir, opts->clearlinks, err);
|
return output_links (iter, opts->linksdir, opts->clearlinks, err);
|
||||||
case MU_CONFIG_FORMAT_PLAIN:
|
case MU_CONFIG_FORMAT_PLAIN:
|
||||||
return output_plain (iter, opts->fields, opts->summary,
|
return output_plain (iter, opts->fields, opts->summary,
|
||||||
opts->threads, opts->color,
|
opts->threads, !opts->nocolor,
|
||||||
opts->include_unreadable, err);
|
opts->include_unreadable, err);
|
||||||
case MU_CONFIG_FORMAT_XML:
|
case MU_CONFIG_FORMAT_XML:
|
||||||
return output_xml (iter, opts->include_unreadable, err);
|
return output_xml (iter, opts->include_unreadable, err);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -148,9 +148,8 @@ backspace (unsigned u)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_stats (MuIndexStats* stats, gboolean clear)
|
print_stats (MuIndexStats* stats, gboolean clear, gboolean color)
|
||||||
{
|
{
|
||||||
const char *kars="-\\|/";
|
const char *kars="-\\|/";
|
||||||
char output[120];
|
char output[120];
|
||||||
|
@ -161,25 +160,49 @@ print_stats (MuIndexStats* stats, gboolean clear)
|
||||||
if (clear)
|
if (clear)
|
||||||
backspace (len);
|
backspace (len);
|
||||||
|
|
||||||
len = (unsigned)snprintf (output, sizeof(output),
|
if (color)
|
||||||
"%c processing mail; processed: %u; "
|
len = (unsigned)snprintf
|
||||||
"updated/new: %u, cleaned-up: %u",
|
(output, sizeof(output),
|
||||||
(unsigned)kars[++i % 4],
|
MU_COLOR_BLUE "%c " MU_COLOR_DEFAULT
|
||||||
(unsigned)stats->_processed,
|
"processing mail; processed: "
|
||||||
(unsigned)stats->_updated,
|
MU_COLOR_GREEN "%u; " MU_COLOR_DEFAULT
|
||||||
(unsigned)stats->_cleaned_up);
|
"updated/new: "
|
||||||
|
MU_COLOR_GREEN "%u" MU_COLOR_DEFAULT
|
||||||
|
", cleaned-up: "
|
||||||
|
MU_COLOR_GREEN "%u" MU_COLOR_DEFAULT,
|
||||||
|
(unsigned)kars[++i % 4],
|
||||||
|
(unsigned)stats->_processed,
|
||||||
|
(unsigned)stats->_updated,
|
||||||
|
(unsigned)stats->_cleaned_up);
|
||||||
|
else
|
||||||
|
len = (unsigned)snprintf
|
||||||
|
(output, sizeof(output),
|
||||||
|
"%c "
|
||||||
|
"processing mail; processed: %u; "
|
||||||
|
"updated/new: %u, cleaned-up: %u",
|
||||||
|
(unsigned)kars[++i % 4],
|
||||||
|
(unsigned)stats->_processed,
|
||||||
|
(unsigned)stats->_updated,
|
||||||
|
(unsigned)stats->_cleaned_up);
|
||||||
|
|
||||||
fputs (output, stdout);
|
fputs (output, stdout);
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct _IndexData {
|
||||||
|
gboolean color;
|
||||||
|
};
|
||||||
|
typedef struct _IndexData IndexData;
|
||||||
|
|
||||||
|
|
||||||
static MuError
|
static MuError
|
||||||
index_msg_cb (MuIndexStats* stats, void *user_data)
|
index_msg_cb (MuIndexStats* stats, IndexData *idata)
|
||||||
{
|
{
|
||||||
if (stats->_processed % 25)
|
if (stats->_processed % 25)
|
||||||
return MU_OK;
|
return MU_OK;
|
||||||
|
|
||||||
print_stats (stats, TRUE);
|
print_stats (stats, TRUE, idata->color);
|
||||||
|
|
||||||
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
||||||
}
|
}
|
||||||
|
@ -217,13 +240,28 @@ database_version_check_and_update (MuStore *store, MuConfig *opts,
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_time (unsigned t, unsigned processed)
|
show_time (unsigned t, unsigned processed, gboolean color)
|
||||||
{
|
{
|
||||||
if (t)
|
|
||||||
g_message ("elapsed: %u second(s), ~ %u msg/s",
|
if (color) {
|
||||||
t, processed/t);
|
if (t)
|
||||||
else
|
g_message ("elapsed: "
|
||||||
g_message ("elapsed: %u second(s)", t);
|
MU_COLOR_GREEN "%u" MU_COLOR_DEFAULT
|
||||||
|
" second(s), ~ "
|
||||||
|
MU_COLOR_GREEN "%u" MU_COLOR_DEFAULT
|
||||||
|
" msg/s",
|
||||||
|
t, processed/t);
|
||||||
|
else
|
||||||
|
g_message ("elapsed: "
|
||||||
|
MU_COLOR_GREEN "%u" MU_COLOR_DEFAULT
|
||||||
|
" second(s)", t);
|
||||||
|
} else {
|
||||||
|
if (t)
|
||||||
|
g_message ("elapsed: %u second(s), ~ %u msg/s",
|
||||||
|
t, processed/t);
|
||||||
|
else
|
||||||
|
g_message ("elapsed: %u second(s)", t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -234,6 +272,7 @@ cleanup_missing (MuIndex *midx, MuConfig *opts, MuIndexStats *stats,
|
||||||
{
|
{
|
||||||
MuError rv;
|
MuError rv;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
IndexData idata;
|
||||||
|
|
||||||
g_message ("cleaning up messages [%s]",
|
g_message ("cleaning up messages [%s]",
|
||||||
mu_runtime_path (MU_RUNTIME_PATH_XAPIANDB));
|
mu_runtime_path (MU_RUNTIME_PATH_XAPIANDB));
|
||||||
|
@ -241,13 +280,19 @@ cleanup_missing (MuIndex *midx, MuConfig *opts, MuIndexStats *stats,
|
||||||
mu_index_stats_clear (stats);
|
mu_index_stats_clear (stats);
|
||||||
|
|
||||||
t = time (NULL);
|
t = time (NULL);
|
||||||
rv = mu_index_cleanup (midx, stats,
|
idata.color = !opts->nocolor;
|
||||||
show_progress ? index_msg_cb : index_msg_silent_cb,
|
rv = mu_index_cleanup
|
||||||
NULL, err);
|
(midx, stats,
|
||||||
|
show_progress ?
|
||||||
|
(MuIndexCleanupDeleteCallback)index_msg_cb :
|
||||||
|
(MuIndexCleanupDeleteCallback)index_msg_silent_cb,
|
||||||
|
&idata, err);
|
||||||
|
|
||||||
if (!opts->quiet) {
|
if (!opts->quiet) {
|
||||||
print_stats (stats, TRUE);
|
print_stats (stats, TRUE, !opts->nocolor);
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
show_time ((unsigned)(time(NULL)-t),stats->_processed);
|
show_time ((unsigned)(time(NULL)-t),stats->_processed,
|
||||||
|
!opts->nocolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (rv == MU_OK || rv == MU_STOP) ? MU_OK: MU_G_ERROR_CODE(err);
|
return (rv == MU_OK || rv == MU_STOP) ? MU_OK: MU_G_ERROR_CODE(err);
|
||||||
|
@ -259,6 +304,7 @@ static MuError
|
||||||
cmd_index (MuIndex *midx, MuConfig *opts, MuIndexStats *stats,
|
cmd_index (MuIndex *midx, MuConfig *opts, MuIndexStats *stats,
|
||||||
gboolean show_progress, GError **err)
|
gboolean show_progress, GError **err)
|
||||||
{
|
{
|
||||||
|
IndexData idata;
|
||||||
MuError rv;
|
MuError rv;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
|
@ -266,14 +312,18 @@ cmd_index (MuIndex *midx, MuConfig *opts, MuIndexStats *stats,
|
||||||
mu_runtime_path (MU_RUNTIME_PATH_XAPIANDB));
|
mu_runtime_path (MU_RUNTIME_PATH_XAPIANDB));
|
||||||
|
|
||||||
t = time (NULL);
|
t = time (NULL);
|
||||||
|
idata.color = !opts->nocolor;
|
||||||
rv = mu_index_run (midx, opts->maildir, opts->reindex, stats,
|
rv = mu_index_run (midx, opts->maildir, opts->reindex, stats,
|
||||||
show_progress ? index_msg_cb:index_msg_silent_cb,
|
show_progress ?
|
||||||
NULL, NULL);
|
(MuIndexMsgCallback)index_msg_cb :
|
||||||
|
(MuIndexMsgCallback)index_msg_silent_cb,
|
||||||
|
NULL, &idata);
|
||||||
|
|
||||||
if (!opts->quiet) {
|
if (!opts->quiet) {
|
||||||
print_stats (stats, TRUE);
|
print_stats (stats, TRUE, !opts->nocolor);
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
show_time ((unsigned)(time(NULL)-t),stats->_processed);
|
show_time ((unsigned)(time(NULL)-t),
|
||||||
|
stats->_processed, !opts->nocolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rv == MU_OK || rv == MU_STOP)
|
if (rv == MU_OK || rv == MU_STOP)
|
||||||
|
@ -348,4 +398,3 @@ mu_cmd_index (MuStore *store, MuConfig *opts, GError **err)
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2010-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2010-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -180,7 +180,8 @@ handle_msg (const char *fname, MuConfig *opts, GError **err)
|
||||||
|
|
||||||
switch (opts->format) {
|
switch (opts->format) {
|
||||||
case MU_CONFIG_FORMAT_PLAIN:
|
case MU_CONFIG_FORMAT_PLAIN:
|
||||||
rv = view_msg_plain (msg, NULL, opts->summary, opts->color);
|
rv = view_msg_plain (msg, NULL, opts->summary,
|
||||||
|
!opts->nocolor);
|
||||||
break;
|
break;
|
||||||
case MU_CONFIG_FORMAT_SEXP:
|
case MU_CONFIG_FORMAT_SEXP:
|
||||||
rv = view_msg_sexp (msg);
|
rv = view_msg_sexp (msg);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -80,14 +80,13 @@ set_group_mu_defaults (MuConfig *opts)
|
||||||
opts->muhome = exp;
|
opts->muhome = exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for the MU_COLORS env var; but in any case don't use
|
/* check for the MU_NOCOLOR env var; but in any case don't
|
||||||
* colors unless we're writing to a tty */
|
* use colors unless we're writing to a tty */
|
||||||
|
if (g_getenv (MU_NOCOLOR) != NULL)
|
||||||
if (g_getenv (MU_COLORS) != NULL)
|
opts->nocolor = TRUE;
|
||||||
opts->color = TRUE;
|
|
||||||
|
|
||||||
if (!isatty(fileno(stdout)))
|
if (!isatty(fileno(stdout)))
|
||||||
opts->color = FALSE;
|
opts->nocolor = TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +105,8 @@ config_options_group_mu (MuConfig *opts)
|
||||||
"specify an alternative mu directory", NULL},
|
"specify an alternative mu directory", NULL},
|
||||||
{"log-stderr", 0, 0, G_OPTION_ARG_NONE, &opts->log_stderr,
|
{"log-stderr", 0, 0, G_OPTION_ARG_NONE, &opts->log_stderr,
|
||||||
"log to standard error (false)", NULL},
|
"log to standard error (false)", NULL},
|
||||||
{"color", 0, 0, G_OPTION_ARG_NONE, &opts->color,
|
{"nocolor", 0, 0, G_OPTION_ARG_NONE, &opts->nocolor,
|
||||||
"use ANSI-colors in some output (false)", NULL},
|
"don't use ANSI-colors in some output (false)", NULL},
|
||||||
|
|
||||||
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY,
|
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY,
|
||||||
&opts->params, "parameters", NULL},
|
&opts->params, "parameters", NULL},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/* env var; if non-empty, color are enabled for some commands */
|
/* env var; if non-empty, color are disabled */
|
||||||
#define MU_COLORS "MU_COLORS"
|
#define MU_NOCOLOR "MU_NOCOLOR"
|
||||||
|
|
||||||
|
|
||||||
enum _MuConfigFormat {
|
enum _MuConfigFormat {
|
||||||
|
@ -93,7 +93,8 @@ struct _MuConfig {
|
||||||
gboolean version; /* request mu version */
|
gboolean version; /* request mu version */
|
||||||
gboolean log_stderr; /* log to stderr (not logfile) */
|
gboolean log_stderr; /* log to stderr (not logfile) */
|
||||||
gchar** params; /* parameters (for querying) */
|
gchar** params; /* parameters (for querying) */
|
||||||
gboolean color; /* use ansi-colors in some output */
|
gboolean nocolor; /* don't use use ansi-colors
|
||||||
|
* in some output */
|
||||||
|
|
||||||
/* options for indexing */
|
/* options for indexing */
|
||||||
char *maildir; /* where the mails are */
|
char *maildir; /* where the mails are */
|
||||||
|
|
Loading…
Reference in New Issue