Move --size-unit and --count-unit from adu.ggo to select.ggo.
[adu.git] / select.c
index ef63cf3..e095073 100644 (file)
--- a/select.c
+++ b/select.c
@@ -184,8 +184,8 @@ static int user_stats_loop_function(struct osl_row *row, void *data)
                        goto err;
                files = *(uint64_t *)obj.data;
                if (usi->count && (usi->flags & USF_PRINT_FILES)) {
-                       format_count_value(conf.count_unit_arg, files,
-                               conf.count_unit_arg == count_unit_arg_h,
+                       format_count_value(select_conf.count_unit_arg, files,
+                               select_conf.count_unit_arg == count_unit_arg_h,
                                formated_value);
                        printf("\t%s%s", formated_value,
                                (usi->flags & (USF_PRINT_BYTES | USF_PRINT_DIRNAME))?
@@ -202,8 +202,8 @@ static int user_stats_loop_function(struct osl_row *row, void *data)
                        goto err;
                bytes = *(uint64_t *)obj.data;
                if (usi->count && (usi->flags & USF_PRINT_BYTES)) {
-                       format_size_value(conf.size_unit_arg, bytes,
-                               conf.size_unit_arg == size_unit_arg_h,
+                       format_size_value(select_conf.size_unit_arg, bytes,
+                               select_conf.size_unit_arg == size_unit_arg_h,
                                formated_value);
                        printf("%s%s%s",
                                (usi->flags & USF_PRINT_FILES)? "" : "\t",
@@ -258,8 +258,8 @@ static int global_stats_loop_function(struct osl_row *row, void *data)
                        goto err;
                files = *(uint64_t *)obj.data;
                if (gsi->count && (gsi->flags & GSF_PRINT_FILES)) {
-                       format_count_value(conf.count_unit_arg, files,
-                               conf.count_unit_arg == count_unit_arg_h,
+                       format_count_value(select_conf.count_unit_arg, files,
+                               select_conf.count_unit_arg == count_unit_arg_h,
                                formated_value);
                        printf("\t%s%s", formated_value,
                                (gsi->flags & (GSF_PRINT_BYTES | GSF_PRINT_DIRNAME))?
@@ -275,8 +275,8 @@ static int global_stats_loop_function(struct osl_row *row, void *data)
                        goto err;
                bytes = *(uint64_t *)obj.data;
                if (gsi->count && (gsi->flags & GSF_PRINT_BYTES)) {
-                       format_size_value(conf.size_unit_arg, bytes,
-                               conf.size_unit_arg == size_unit_arg_h,
+                       format_size_value(select_conf.size_unit_arg, bytes,
+                               select_conf.size_unit_arg == size_unit_arg_h,
                                formated_value);
                        printf("%s%s%s",
                                (gsi->flags & GSF_PRINT_FILES)? "" : "\t",
@@ -341,9 +341,9 @@ static void print_global_summary(void)
 
        if (conf.no_global_summary_given)
                return;
-       ud = format_count_value(conf.count_unit_arg, num_dirs, 0, d);
-       uf = format_count_value(conf.count_unit_arg, num_files, 0, f);
-       us = format_size_value(conf.size_unit_arg, num_bytes, 0, s);
+       ud = format_count_value(select_conf.count_unit_arg, num_dirs, 0, d);
+       uf = format_count_value(select_conf.count_unit_arg, num_files, 0, f);
+       us = format_size_value(select_conf.size_unit_arg, num_bytes, 0, s);
 
        if (!conf.no_headers_given)
                printf("Global summary "
@@ -361,14 +361,14 @@ static int print_user_summary_line(struct user_info *ui, __a_unused void *data)
                formated_file_count[FORMATED_VALUE_SIZE],
                formated_bytes[FORMATED_VALUE_SIZE ];
 
-       format_count_value(conf.count_unit_arg, ui->dirs,
-               conf.count_unit_arg == count_unit_arg_h,
+       format_count_value(select_conf.count_unit_arg, ui->dirs,
+               select_conf.count_unit_arg == count_unit_arg_h,
                formated_dir_count);
-       format_count_value(conf.count_unit_arg, ui->files,
-               conf.count_unit_arg == count_unit_arg_h,
+       format_count_value(select_conf.count_unit_arg, ui->files,
+               select_conf.count_unit_arg == count_unit_arg_h,
                formated_file_count);
-       format_size_value(conf.size_unit_arg, ui->bytes,
-               conf.size_unit_arg == size_unit_arg_h,
+       format_size_value(select_conf.size_unit_arg, ui->bytes,
+               select_conf.size_unit_arg == size_unit_arg_h,
                formated_bytes);
        printf("\t%s\t%u\t%s\t%s\t%s\n",
                ui->pw_name? ui->pw_name : "?",
@@ -607,12 +607,12 @@ int com_select(void)
                        return ret;
        }
 
-       if (conf.count_unit_arg != count_unit_arg_h)
-               count_unit_buf[1] = count_unit_abbrevs[conf.count_unit_arg];
+       if (select_conf.count_unit_arg != count_unit_arg_h)
+               count_unit_buf[1] = count_unit_abbrevs[select_conf.count_unit_arg];
        else
                count_unit_buf[0] = '\0';
-       if (conf.size_unit_arg != size_unit_arg_h)
-               size_unit_buf[1] = size_unit_abbrevs[conf.size_unit_arg];
+       if (select_conf.size_unit_arg != size_unit_arg_h)
+               size_unit_buf[1] = size_unit_abbrevs[select_conf.size_unit_arg];
        else
                size_unit_buf[0] = '\0';