- enum enum_global_list gla = conf.global_list_arg;
- int print_size_list = (gla == global_list_arg_size
- || gla == global_list_arg_both);
-
- if (print_size_list) {
- gsi.count = conf.limit_arg;
- gsi.flags = GSF_PRINT_DIRNAME | GSF_PRINT_BYTES | GSF_COMPUTE_SUMMARY;
- if (!conf.no_headers_given)
- printf("By size%s:\n", size_unit_buf);
- ret = adu_loop_reverse(dir_table, DT_BYTES, &gsi,
- global_stats_loop_function, &gsi.ret, &gsi.osl_errno);
- if (ret < 0)
- return ret;
- printf("\n");
- }
- if (gla == global_list_arg_file_count || gla == global_list_arg_both) {
- gsi.count = conf.limit_arg;
- gsi.flags = GSF_PRINT_DIRNAME | GSF_PRINT_FILES;
- if (!print_size_list)
- gsi.flags |= GSF_COMPUTE_SUMMARY;
- if (!conf.no_headers_given)
- printf("By file count%s:\n", count_unit_buf);
- ret = adu_loop_reverse(dir_table, DT_FILES, &gsi,
- global_stats_loop_function, &gsi.ret, &gsi.osl_errno);
- if (ret < 0)
- return ret;
- printf("\n");
- }
- if (gla == global_list_arg_none && !conf.no_global_summary_given) {
- /* must compute summary */
- gsi.count = conf.limit_arg;
- gsi.flags = GSF_COMPUTE_SUMMARY;
- ret = adu_loop_reverse(dir_table, DT_FILES, &gsi,
- global_stats_loop_function, &gsi.ret, &gsi.osl_errno);
+ enum dir_table_columns sort_column = DT_BYTES;
+ struct global_list_info gli = {
+ .fi = fi,
+ .count = select_conf.limit_arg
+ };
+
+ if (!select_conf.no_headers_given) {
+ ret = output("Global list\n");