users. Decreasing the value causes adu to use slightly less memory.
"
-##############################
-section "Options for --select"
-##############################
-
option "select-options" s
#~~~~~~~~~~~~~~~~~~~~~~~~~
-"options for select mode"
+"Options for select mode"
string typestr="<options>"
optional
dependon="select"
details="
Try --select-options \"-h\"
"
-
-option "print-base-dir" -
-#~~~~~~~~~~~~~~~~~~~~~~~~
-"whether to include the base-dir in the output"
-flag off
-details="
- If this flag is given, all directories printed are prefixed
- with the base directory. The default is to print paths relative
- to the base dir.
-"
-
-option "no-headers" -
-#~~~~~~~~~~~~~~~~~~~~
-"supress descriptions for listings/tables"
-flag off
-dependon="select"
-details="
- This is mostly useful to feed the output of adu to scripts.
-"
-
-option "global-list" -
-#~~~~~~~~~~~~~~~~~~~~~
-"how to print global directory listings"
-enum typestr="which"
-values="size","file_count","both","none"
-default="both"
-optional
-dependon="select"
-details="
- By default adu prints two global directory listings: The
- first prints the directory names ordered by the sum of the
- sizes of the contained files while the second listing prints
- them sorted by the number of files. This option can be used
- to print only one or neither of these two listings.
-"
-
-option "no-global-summary" -
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~
-"do not print the summary line"
-flag off
-dependon="select"
-
-option "user-list" -
-#~~~~~~~~~~~~~~~~~~~
-"how to print per-user directory listings"
-enum typestr="which"
-values="size","file_count","both","none"
-default="both"
-optional
-dependon="select"
-details="
- Similar to the global directory listings mentioned above,
- adu can print two directory listings per user. This option
- controls which of the these should be printed.
-"
-
ret = osl(osl_get_object(dir_table, row, DT_NAME, &obj));
if (ret < 0)
goto out;
- pfx = (conf.print_base_dir_given || val)? (char *)obj.data : ".";
+ pfx = (select_conf.print_base_dir_given || val)? (char *)obj.data : ".";
tmp = make_message("%s/%s", pfx, result? result : "");
free(result);
result = tmp;
enum enum_count_unit ud, uf;
enum enum_size_unit us;
- if (conf.no_global_summary_given)
+ if (select_conf.no_global_summary_given)
return;
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)
+ if (!select_conf.no_headers_given)
printf("Global summary "
"(dirs(%c)/files(%c)/size(%c))\n",
count_unit_abbrevs[ud],
{
if (select_conf.no_user_summary_given)
return;
- if (!conf.no_headers_given)
+ if (!select_conf.no_headers_given)
printf("User summary "
"(pw_name/uid/dirs%s/files%s/size%s):\n",
count_unit_buf, count_unit_buf, size_unit_buf);
{
int ret;
struct user_stats_info usi;
- enum enum_user_list ula = conf.user_list_arg;
+ enum enum_user_list ula = select_conf.user_list_arg;
int print_size_list = (ula == user_list_arg_size
|| ula == user_list_arg_both);
usi.count = select_conf.limit_arg;
usi.ui = ui;
usi.flags = USF_PRINT_DIRNAME | USF_PRINT_BYTES | USF_COMPUTE_SUMMARY;
- if (!conf.no_headers_given)
+ if (!select_conf.no_headers_given)
printf("%s (uid %u), by size%s:\n",
ui->pw_name? ui->pw_name : "?", (unsigned)ui->uid,
size_unit_buf);
printf("\n");
}
if (ula == user_list_arg_file_count || ula == user_list_arg_both) {
- if (!conf.no_headers_given)
+ if (!select_conf.no_headers_given)
printf("%s (uid %u), by file count%s:\n",
ui->pw_name? ui->pw_name : "?", (unsigned)ui->uid,
count_unit_buf);
{
struct global_stats_info gsi;
int ret;
- enum enum_global_list gla = conf.global_list_arg;
+ enum enum_global_list gla = select_conf.global_list_arg;
int print_size_list = (gla == global_list_arg_size
|| gla == global_list_arg_both);
if (print_size_list) {
gsi.count = select_conf.limit_arg;
gsi.flags = GSF_PRINT_DIRNAME | GSF_PRINT_BYTES | GSF_COMPUTE_SUMMARY;
- if (!conf.no_headers_given)
+ if (!select_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);
gsi.flags = GSF_PRINT_DIRNAME | GSF_PRINT_FILES;
if (!print_size_list)
gsi.flags |= GSF_COMPUTE_SUMMARY;
- if (!conf.no_headers_given)
+ if (!select_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);
return ret;
printf("\n");
}
- if (gla == global_list_arg_none && !conf.no_global_summary_given) {
+ if (gla == global_list_arg_none && !select_conf.no_global_summary_given) {
/* must compute summary */
gsi.count = select_conf.limit_arg;
gsi.flags = GSF_COMPUTE_SUMMARY;
#~~~~~~~~~~~~~~~~~~~~~~~~~~~
"do not print the user summary table"
flag off
+
+
+option "user-list" -
+#~~~~~~~~~~~~~~~~~~~
+"how to print per-user directory listings"
+enum typestr="which"
+values="size","file_count","both","none"
+default="both"
+optional
+details="
+ Similar to the global directory listings mentioned above,
+ adu can print two directory listings per user. This option
+ controls which of the these should be printed.
+"
+option "no-global-summary" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"do not print the summary line"
+flag off
+
+option "global-list" -
+#~~~~~~~~~~~~~~~~~~~~~
+"how to print global directory listings"
+enum typestr="which"
+values="size","file_count","both","none"
+default="both"
+optional
+details="
+ By default adu prints two global directory listings: The
+ first prints the directory names ordered by the sum of the
+ sizes of the contained files while the second listing prints
+ them sorted by the number of files. This option can be used
+ to print only one or neither of these two listings.
+"
+option "print-base-dir" -
+#~~~~~~~~~~~~~~~~~~~~~~~~
+"whether to include the base-dir in the output"
+flag off
+details="
+ If this flag is given, all directories printed are prefixed
+ with the base directory. The default is to print paths relative
+ to the base dir.
+"