summaryrefslogtreecommitdiffstats
path: root/source/helper.c
diff options
context:
space:
mode:
authorDave Davenport <DaveDavenport@users.noreply.github.com>2018-06-13 11:57:23 +0200
committerGitHub <noreply@github.com>2018-06-13 11:57:23 +0200
commitbdb6abef4a2b3cd3c02443038f43af74fd1bc987 (patch)
tree87bdccfad5df3647003c9b10cf094b0fe9293ddb /source/helper.c
parent9909fb3d7108c2cea200848d3e2a766f46be2f3b (diff)
Sorting cleanup (#816)
* Add `-sorting-method` option remove weird -sort-levenshtein. * Fix test for updated cmdline options. * Update manpage
Diffstat (limited to 'source/helper.c')
-rw-r--r--source/helper.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/helper.c b/source/helper.c
index 55e688db..52922912 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -578,6 +578,22 @@ int config_sanity_check ( void )
GString *msg = g_string_new (
"<big><b>The configuration failed to validate:</b></big>\n" );
+ if ( config.sorting_method ) {
+ if ( g_strcmp0 ( config.sorting_method, "normal" ) == 0 ) {
+ config.sorting_method_enum = SORT_NORMAL;
+ }
+ else if ( g_strcmp0 ( config.sorting_method, "levenshtein" ) == 0 ) {
+ config.sorting_method_enum = SORT_NORMAL;
+ }
+ else if ( g_strcmp0 ( config.sorting_method, "fzf" ) == 0 ) {
+ config.sorting_method_enum = SORT_FZF;
+ } else {
+ g_string_append_printf ( msg, "\t<b>config.sorting_method</b>=%s is not a valid sorting strategy.\nValid options are: normal or fzf.\n",
+ config.sorting_method );
+ found_error = 1;
+ }
+ }
+
if ( config.matching ) {
if ( g_strcmp0 ( config.matching, "regex" ) == 0 ) {
config.matching_method = MM_REGEX;