]> git.deb.at Git - pkg/abook.git/blobdiff - options.c
mutt import filter changes
[pkg/abook.git] / options.c
index 3947a38a959855a5621c4673c00bafbb8b198033..fe75878abb225b056e950f0c2a34cceaba7f9d72 100644 (file)
--- a/options.c
+++ b/options.c
@@ -65,18 +65,19 @@ static struct option abook_vars[] = {
        { "use_ascii_only", OT_BOOL, BOOL_USE_ASCII_ONLY, FALSE },
 
        { "add_email_prevent_duplicates", OT_BOOL, BOOL_ADD_EMAIL_PREVENT_DUPLICATES, FALSE },
+       { "sort_field", OT_STR, STR_SORT_FIELD, UL "nick" },
 
        { NULL }
 };
 
 static unsigned char bool_opts[BOOL_MAX];
-static int int_opts[INT_MAX];
+static int int_opts[INT_MAXIMUM];
 static char *str_opts[STR_MAX];
 
 static void
 set_int(enum int_opts opt, int value)
 {
-       assert(opt >= 0 && opt < INT_MAX);
+       assert(opt >= 0 && opt < INT_MAXIMUM);
 
        int_opts[opt] = value;
 }
@@ -103,7 +104,7 @@ set_str(enum str_opts opt, char *value)
 int
 opt_get_int(enum int_opts opt)
 {
-       assert(opt >= 0 && opt < INT_MAX);
+       assert(opt >= 0 && opt < INT_MAXIMUM);
 
        return int_opts[opt];
 }
@@ -339,7 +340,7 @@ load_opts(char *filename)
        FILE *in;
        char *line = NULL;
        int n;
-       bool err = FALSE;
+       int err = 0;
        
        if((in = fopen(filename, "r")) == NULL)
                return -1;
@@ -354,7 +355,7 @@ load_opts(char *filename)
                if(line && *line) {
                        opt_line_remove_comments(line);
                        if(*line)
-                               err = opt_parse_line(line, n, filename);
+                               err += opt_parse_line(line, n, filename) ? 1:0;
                }
 
                my_free(line);
@@ -362,11 +363,6 @@ load_opts(char *filename)
 
        free(line);
 
-       if(err) {
-               printf("Press enter to continue...\n");
-               fgetc(stdin);
-       }
-       
        return err;
 }