* src/, man/, NEWS: rename --descending into --reverse

This commit is contained in:
Dirk-Jan C. Binnema
2011-09-22 21:00:52 +03:00
parent 3d41a0fe3d
commit e2fc573d42
7 changed files with 56 additions and 56 deletions

4
NEWS
View File

@ -1,5 +1,9 @@
* NEWS (user visible changes) * NEWS (user visible changes)
** Release 0.9.8 <>
- '--descending' has been renamed into '--reverse'
* Release 0.9.7 <> * Release 0.9.7 <>
- don't enforce UTF-8 output, use locale (fixes issue #11) - don't enforce UTF-8 output, use locale (fixes issue #11)

View File

@ -265,7 +265,7 @@ and not here, as they apply to multiple mu-commands.
The \fBfind\fR-command has various options that influence the way \fBmu\fR The \fBfind\fR-command has various options that influence the way \fBmu\fR
displays the results. If you don't specify anything, the defaults are displays the results. If you don't specify anything, the defaults are
\fI\-\-fields="d f s"\fR, \fI\-\-sortfield=date\fR and \fI\-\-descending\fR. \fI\-\-fields="d f s"\fR, \fI\-\-sortfield=date\fR and \fI\-\-reverse\fR.
.TP .TP
\fB\-f\fR, \fB\-\-fields\fR=\fI<fields>\fR \fB\-f\fR, \fB\-\-fields\fR=\fI<fields>\fR
@ -307,8 +307,9 @@ have 'asz' as its corresponding output string, while an encrypted new message
would have 'nx'. would have 'nx'.
.TP .TP
\fB\-s\fR, \fB\-\-sortfield\fR \fR=\fI<field>\fR and \fB\-z\fR, \fB\-\-descending\fR \fB\-s\fR, \fB\-\-sortfield\fR \fR=\fI<field>\fR and \fB\-z\fR,
specifies the field to sort the search results by, and the direction. The \fB\-\-reverse\fR specifies the field to sort the search results by, and the
direction (i.e., 'reverse' means that the sort should be reverted - Z-A). The
following fields are supported: following fields are supported:
.nf .nf
@ -326,11 +327,11 @@ following fields are supported:
Thus, for example, to sort messages by date, you could specify: Thus, for example, to sort messages by date, you could specify:
.nf .nf
$ mu find fahrrad --fields "d f s" --sortfield=date --descending $ mu find fahrrad --fields "d f s" --sortfield=date --reverse
.fi .fi
Note, if you specify a sortfield, by default, messages are sorted in Note, if you specify a sortfield, by default, messages are sorted in reverse
descending order (e.g., from lowest to highest). This is usually a good (descending) order (e.g., from lowest to highest). This is usually a good
choice, but for dates it may be more useful to sort in the opposite direction. choice, but for dates it may be more useful to sort in the opposite direction.
.TP .TP

View File

@ -129,7 +129,7 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts,
} }
iter = mu_query_run (xapian, query, opts->threads, sortid, iter = mu_query_run (xapian, query, opts->threads, sortid,
opts->descending ? FALSE : TRUE, err); opts->reverse, err);
return iter; return iter;
} }

View File

@ -166,12 +166,8 @@ set_group_find_defaults (MuConfig *opts)
* *are* specified, we sort in ascending order. */ * *are* specified, we sort in ascending order. */
if (!opts->fields) { if (!opts->fields) {
opts->fields = "d f s"; opts->fields = "d f s";
if (!opts->sortfield) { if (!opts->sortfield)
opts->sortfield = "d"; opts->sortfield = "d";
opts->descending = TRUE;
} else
opts->descending = FALSE;
} }
if (!opts->formatstr) /* by default, use plain output */ if (!opts->formatstr) /* by default, use plain output */
@ -203,8 +199,8 @@ config_options_group_find (MuConfig *opts)
"show message threads", NULL}, "show message threads", NULL},
{"bookmark", 'b', 0, G_OPTION_ARG_STRING, &opts->bookmark, {"bookmark", 'b', 0, G_OPTION_ARG_STRING, &opts->bookmark,
"use a bookmarked query", NULL}, "use a bookmarked query", NULL},
{"descending", 'z', 0, G_OPTION_ARG_NONE, &opts->descending, {"reverse", 'z', 0, G_OPTION_ARG_NONE, &opts->reverse,
"sort in descending order (z -> a)", NULL}, "sort in reverse (descending) order (z -> a)", NULL},
{"summary", 'k', 0, G_OPTION_ARG_NONE, &opts->summary, {"summary", 'k', 0, G_OPTION_ARG_NONE, &opts->summary,
"include a short summary of the message (false)", NULL}, "include a short summary of the message (false)", NULL},
{"linksdir", 0, 0, G_OPTION_ARG_STRING, &opts->linksdir, {"linksdir", 0, 0, G_OPTION_ARG_STRING, &opts->linksdir,

View File

@ -111,7 +111,7 @@ struct _MuConfig {
/* options for querying 'find' (and view-> 'summary') */ /* options for querying 'find' (and view-> 'summary') */
char *fields; /* fields to show in output */ char *fields; /* fields to show in output */
char *sortfield; /* field to sort by (string) */ char *sortfield; /* field to sort by (string) */
gboolean descending; /* sort descending (z->a)? */ gboolean reverse; /* sort in revers order (z->a) */
gboolean threads; /* show message threads */ gboolean threads; /* show message threads */
gboolean summary; /* include a summary? */ gboolean summary; /* include a summary? */
char *bookmark; /* use bookmark */ char *bookmark; /* use bookmark */

View File

@ -296,7 +296,7 @@ mu_query_preprocess (const char *query)
MuMsgIter* MuMsgIter*
mu_query_run (MuQuery *self, const char* searchexpr, gboolean threads, mu_query_run (MuQuery *self, const char* searchexpr, gboolean threads,
MuMsgFieldId sortfieldid, gboolean ascending, MuMsgFieldId sortfieldid, gboolean reverse,
GError **err) GError **err)
{ {
g_return_val_if_fail (self, NULL); g_return_val_if_fail (self, NULL);
@ -311,8 +311,7 @@ mu_query_run (MuQuery *self, const char* searchexpr, gboolean threads,
* there, and don't let Xapian do any sorting */ * there, and don't let Xapian do any sorting */
if (!threads && sortfieldid != MU_MSG_FIELD_ID_NONE) if (!threads && sortfieldid != MU_MSG_FIELD_ID_NONE)
enq.set_sort_by_value ((Xapian::valueno)sortfieldid, enq.set_sort_by_value ((Xapian::valueno)sortfieldid,
ascending ? true : false); reverse ? true : false);
if (!mu_str_is_empty(searchexpr)) /* NULL or "" */ if (!mu_str_is_empty(searchexpr)) /* NULL or "" */
enq.set_query(get_query (self, searchexpr, err)); enq.set_query(get_query (self, searchexpr, err));
else else

View File

@ -73,8 +73,8 @@ char* mu_query_version (MuQuery *store)
* @param threads calculate message-threads * @param threads calculate message-threads
* @param sortfield the field id to sort by or MU_MSG_FIELD_ID_NONE if * @param sortfield the field id to sort by or MU_MSG_FIELD_ID_NONE if
* sorting is not desired * sorting is not desired
* @param ascending if TRUE sort in ascending (A-Z) order, otherwise, * @param reverse if TRUE, sort in descending (Z-A) order, otherwise,
* sort in descending (Z-A) order * sort in descending (A-Z) order
* @param err receives error information (if there is any); if * @param err receives error information (if there is any); if
* function returns non-NULL, err will _not_be set. err can be NULL * function returns non-NULL, err will _not_be set. err can be NULL
* possible error (err->code) is MU_ERROR_QUERY, * possible error (err->code) is MU_ERROR_QUERY,