]> git.tuebingen.mpg.de Git - adu.git/blobdiff - select.ggo
Introduce select-mode and use pretty formating for the global lists.
[adu.git] / select.ggo
index f4d090b1e05bf6f9f72adca3b322f32b81c33373..b0b1daa6f007c5e13958ca799a7d6e32dec8b206 100644 (file)
@@ -33,6 +33,20 @@ details="
        This is mostly useful to feed the output of adu to scripts.
 "
 
        This is mostly useful to feed the output of adu to scripts.
 "
 
+option "select-mode" m
+#~~~~~~~~~~~~~~~~~~~~~
+"How to print the results of the query"
+enum typestr="<key>"
+values="global_list","global_summary","user_list","user_summary"
+default="global_list"
+optional
+details="
+       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 "sort" s
 #~~~~~~~~~~~~~~~
 "how to sort the output"
 option "sort" s
 #~~~~~~~~~~~~~~~
 "how to sort the output"
@@ -44,20 +58,6 @@ details="
        Sort by file size, file count or unsorted.
 "
 
        Sort by file size, file count or unsorted.
 "
 
-option "format" f
-#~~~~~~~~~~~~~~~~~
-"how to format the output"
-string typestr="<format>"
-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
-"
-
 option "output" o
 #~~~~~~~~~~~~~~~~
 "file to write output to"
 option "output" o
 #~~~~~~~~~~~~~~~~
 "file to write output to"
@@ -154,3 +154,45 @@ details="
        with the base directory. The default is to print paths relative
        to the base dir.
 "
        with the base directory. The default is to print paths relative
        to the base dir.
 "
+
+########################
+section "Format strings"
+########################
+
+option "global-list-format" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"How to format the global list"
+string typestr="<format>"
+default="%(size:r:8) %(files:r:8) %(dirname)\n"
+details="
+       size: Total size of all files
+       files: The number of files
+       dirname: The name of the directory
+"
+
+optional
+option "global-summary-format" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"How to format the global summary"
+string typestr="<format>"
+default="#directories: %(dirs), #files: %(files), size: %(size)\n\n"
+details="
+       dirs: The number of directories
+       files: The number of files
+       size: Total size of all files
+"
+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