]> git.tuebingen.mpg.de Git - adu.git/blobdiff - select.ggo
Make the array of summary comparators local.
[adu.git] / select.ggo
index f4d090b1e05bf6f9f72adca3b322f32b81c33373..660839b28c5fdc6236a3e1958e530dc67bbd0885 100644 (file)
@@ -27,35 +27,36 @@ details="
 
 option "no-headers" -
 #~~~~~~~~~~~~~~~~~~~~
-"supress descriptions for listings/tables"
+"supress descriptions for listings/summaries"
 flag off
 details="
        This is mostly useful to feed the output of adu to scripts.
 "
 
-option "sort" s
-#~~~~~~~~~~~~~~~
-"how to sort the output"
+option "select-mode" m
+#~~~~~~~~~~~~~~~~~~~~~
+"How to print the results of the query"
 enum typestr="<key>"
-values="sizes","files","unsorted"
-default="sizes"
+values="global_list","global_summary","user_list","user_summary"
+default="global_list"
 optional
 details="
-       Sort by file size, file count or unsorted.
+       global_list: List of directories, regardless of owner.
+       global_summary: Only print totals.
+       user_list: Print a list for each admissible uid.
+       user_summary Print totals for each admissible uid.
 "
 
-option "format" f
-#~~~~~~~~~~~~~~~~~
-"how to format the output"
-string typestr="<format>"
+option "list-sort" s
+#~~~~~~~~~~~~~~~~~~~
+"how to sort the user list or the global list"
+enum typestr="<key>"
+values="size","file_count"
+default="size"
 optional
 details="
-       %(basedir)      -- the path given to --base-dir during create
-       %(dir)          -- the name of the directory
-       %(dir_size)     -- the size of the sum of all regular files in this directory
-       %(num_files)    -- the number of regular files in this directory
-       %%              -- interpolates to %
-       %xx             -- interpolates to the character with hex code xx
+       This option is ignored if select-mode is neither \"user_list\", nor
+       \"global_list\".
 "
 
 option "output" o
@@ -68,34 +69,6 @@ details="
        If empty, or not given, use stdout.
 "
 
-option "size-unit" -
-#~~~~~~~~~~~~~~~~~~~
-"select output format for sizes"
-enum typestr="format"
-values="h","b","k","m","g","t"
-default="h"
-optional
-details="
-       Print sizes in the given unit: human-readable, bytes,
-       kilobytes (2^10), megabytes (2^20), gigabytes (2^30), terabytes
-       (2^40). The default is \"h\", i.e. human-readable.
-"
-
-option "count-unit" -
-#~~~~~~~~~~~~~~~~~~~~
-"select output format for counted values"
-enum typestr="format"
-values="h","n","k","m","g","t"
-default="h"
-optional
-details="
-       Print the number of files/directories in the given unit:
-       human-readable, number, number/10^3, number/10^6, number/10^12,
-       number/10^15. The default is to print numbers in human-readable
-       format.
-"
-
-
 option "user-summary-sort" -
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "how to sort the user-summary"
@@ -108,49 +81,67 @@ details="
        e.g. \"--user-summary-sort f\" sorts by file count.
 "
 
-option "no-user-summary" -
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~
-"do not print the user summary table"
+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.
+"
 
+########################
+section "Format strings"
+########################
 
-option "user-list" -
-#~~~~~~~~~~~~~~~~~~~
-"how to print per-user directory listings"
-enum typestr="which"
-values="size","file_count","both","none"
-default="both"
-optional
+option "global-list-format" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"How to format the global list"
+string typestr="<format>"
+default="%(size:r:8) %(files:r:8) %(dirname)\n"
 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.
+       size: Total size of all files
+       files: The number of files
+       dirname: The name of the directory
 "
-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
+option "global-summary-format" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"How to format the global summary"
+string typestr="<format>"
+default="#directories: %(dirs), #files: %(files), size: %(size)\n\n"
 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.
+       dirs: The number of directories
+       files: The number of files
+       size: Total size of all files
 "
-option "print-base-dir" -
-#~~~~~~~~~~~~~~~~~~~~~~~~
-"whether to include the base-dir in the output"
-flag off
+optional
+
+option "user-list-format" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~
+"How to format the user list"
+string typestr="<format>"
+default="%(size:r:5) %(files:r:5) %(dirname)\n"
 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.
+       pw_name: The user name
+       uid: The user id
+       files: The number of files
+       size: size of all files in that directory
+       dirname: The name of the directory
+"
+optional
+option "user-summary-format" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"How to format the user summary"
+string typestr="<format>"
+default="%(pw_name:l:16) %(uid:r:5) %(dirs:r:5) %(files:r:5) %(size:r:5)\n"
+details="
+       pw_name: The user name
+       uid: The user id
+       dirs: The number of directories
+       files: The number of files
+       size: Total size of all files
 "
+optional