]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: fix test
authorKarel Zak <kzak@redhat.com>
Fri, 4 Apr 2014 11:51:47 +0000 (13:51 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 4 Apr 2014 11:51:47 +0000 (13:51 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/test.c

index 4a45a9a53eb423cad134760069a31aa236300cfd..19d35f00a7584e603b9a3c7504c18590cdcc2ac0 100644 (file)
@@ -36,7 +36,11 @@ int main(int argc, char *argv[])
        struct libscols_column *cl;
        int notree = 0, clone = 0, i, color = 0;
 
-       tb = scols_new_table(NULL);
+       setlocale(LC_ALL, "");
+       bindtextdomain(PACKAGE, LOCALEDIR);
+       textdomain(PACKAGE);
+
+       tb = scols_new_table();
        if (!tb)
                err(EXIT_FAILURE, "table initialization failed");
 
@@ -47,14 +51,14 @@ int main(int argc, char *argv[])
                scols_unref_table(tb);
                return EXIT_SUCCESS;
        } else if (argc == 2 && !strcmp(argv[1], "--max")) {
-               scols_table_set_max(tb, 1);
+               scols_table_enable_maxout(tb, 1);
        } else if (argc == 2 && !strcmp(argv[1], "--ascii")) {
-               scols_table_set_ascii(tb, 1);
+               scols_table_enable_ascii(tb, 1);
        } else if (argc == 2 && !strcmp(argv[1], "--raw")) {
-               scols_table_set_raw(tb, 1);
+               scols_table_enable_raw(tb, 1);
                notree = 1;
        } else if (argc == 2 && !strcmp(argv[1], "--export")) {
-               scols_table_set_export(tb, 1);
+               scols_table_enable_export(tb, 1);
                notree = 1;
        } else if (argc == 2 && !strcmp(argv[1], "--list")) {
                notree = 1;
@@ -72,10 +76,6 @@ int main(int argc, char *argv[])
                clone = 1;
        }
 
-       setlocale(LC_ALL, "");
-       bindtextdomain(PACKAGE, LOCALEDIR);
-       textdomain(PACKAGE);
-
        cl = scols_table_new_column(tb, "NAME", 0.3, notree ? 0 : SCOLS_FL_TREE);
        scols_table_enable_colors(tb, color);