]> git.tuebingen.mpg.de Git - adu.git/blob - select.ggo
Move user and user ID related functions to separate files.
[adu.git] / select.ggo
1
2 option "uid" u
3 #~~~~~~~~~~~~~
4 "user id(s) to take into account"
5 string typestr="uid_spec"
6 optional
7 details="
8         An uid specifier may be a single number, or a range of uids.
9         Example:
10
11         Only consider uid 42:
12                 --uid 42
13
14         Only consider uids greater or equal than 42:
15                 --uid 42-
16
17         Only consider uids between 23 and 42, inclusively:
18                 --uid 23-42
19
20         Consider uids 23-42, 666-777 and 88:
21                 --uid 23-42,666-777,88
22 "
23
24 option "limit" L
25 #~~~~~~~~~~~~~~~
26 "Limit output"
27 int  typestr="num"
28 default="-1"
29 optional
30 details="
31         Only print num lines of output. If negative (the default),
32         print all lines.
33 "
34
35 option "no-headers" -
36 #~~~~~~~~~~~~~~~~~~~~
37 "suppress descriptions for listings/summaries"
38 flag off
39 details="
40         This is mostly useful to feed the output of adu to scripts.
41 "
42
43 option "select-mode" m
44 #~~~~~~~~~~~~~~~~~~~~~
45 "How to print the results of the query"
46 enum typestr="<key>"
47 values="global_list","global_summary","user_list","user_summary"
48 default="global_list"
49 optional
50 details="
51         global_list: List of directories, regardless of owner.
52         global_summary: Only print totals.
53         user_list: Print a list for each admissible uid.
54         user_summary Print totals for each admissible uid.
55 "
56
57 option "list-sort" s
58 #~~~~~~~~~~~~~~~~~~~
59 "how to sort the user list or the global list"
60 enum typestr="<key>"
61 values="size","file_count"
62 default="size"
63 optional
64 details="
65         This option is ignored if select-mode is neither \"user_list\", nor
66         \"global_list\".
67 "
68
69 option "output" o
70 #~~~~~~~~~~~~~~~~
71 "file to write output to"
72 string typestr="<path>"
73 optional
74 default="-"
75 details="
76         If empty, or not given, use stdout.
77 "
78
79 option "user-summary-sort" -
80 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
81 "how to sort the user-summary"
82 enum typestr="col_spec"
83 values="name","uid","dir_count","file_count","size"
84 default="size"
85 optional
86 details="
87         It is enough to specify the first letter of the column specifier,
88         e.g. \"--user-summary-sort f\" sorts by file count.
89 "
90
91 option "print-base-dir" -
92 #~~~~~~~~~~~~~~~~~~~~~~~~
93 "whether to include the base-dir in the output"
94 flag off
95 details="
96         If this flag is given, all directories printed are prefixed
97         with the base directory. The default is to print paths relative
98         to the base dir.
99 "
100
101 option "format" f
102 #~~~~~~~~~~~~~~~~
103 "How to format the output"
104 string typestr="<format_string>"
105 optional
106 details="
107
108         A string that specifies how the output of the select query is
109         going to be formated.  Depending on the chosen select-mode,
110         several conversion specifiers are available and a different
111         default value for this option applies.
112
113         adu knows four different types of directives: string, id,
114         count and size.  These are explained in more detail below.
115
116         The general syntax for string and id directives is %(name:a:w)
117         where \"name\" is the name of the directive, \"a\" specifies
118         the alignment and \"w\" is the width specifier which allows
119         to give a field width.
120
121         The alignment specifier is a single character: Either \"l\",
122         \"r\", or \"c\" may be given to specify left, right and
123         centered alignment respectively. The with specifier is a
124         positive integer.  Both \"a\" and \"w\" are optional.
125
126         A string directive supported by adu is \"dirname\" which is
127         substituted by the name of the directory. It is available
128         if either user_list or global_list mode was selected via
129         --select-mode.
130
131         Examples:
132                 Print dirname without any padding:
133
134                 \"%(diname)\"
135
136                 Center dirname in a 20 chars wide field:
137
138                 \"%(dirname:c:20)\"
139
140         The other two types of directives, count and size, are used
141         for numbers. The syntax for these is %(name:a:w:u). The \"a\"
142         and the \"w\" specifier have the same meaning as for the string
143         and id directives. The additional \"u\" specifier selects a unit
144         in which the number that corresponds to the directive should
145         be formated. All three specifiers are optional.
146
147         Possible units are the characters of the set \" bkmgtBKMGT\"
148         specifying bytes, kilobytes, megabytes, gigabytes and
149         terabytes respectively. The difference between the lower and
150         the upper case variants is that the lower case specifiers
151         select 1024-based units while the upper case specifiers use
152         1000 as the basis.
153
154         The whitespace character is like \"b\", but a space character
155         is printed instead of a unit.
156
157         Two more characters \"h\" and \"H\" (human-readable) are also
158         available that choose an appropriate unit depending on the
159         size of the number being printed.
160
161         An asterisk prepended to the unit specifier prevents the
162         unit from being printed. This is useful mainly for feeding
163         the output of adu to scripts that do not expect units.
164
165         In order to print a percent sign, use \"%%\". Moreover, adu
166         understands \"\\n\" and \"\\t\" and outputs a newline and a
167         tab character for these combinations respectively.
168
169         Examples:
170                 Print size in gigabytes right-aligned:
171                         \"%(size:r::G)\"
172
173                 As before, but use 5 char wide field:
174                         \"%(size:r5::G)\"
175
176                 As before, but suppress trailing \"G\":
177                         \"%(size:r5::*G)\"
178
179
180         The following list contains all directives known to adu,
181         together with their types, and for which modes each of
182         them may be used.
183
184                 pw_name (string): user name. Available for user_list
185                 and user_summary
186
187                 uid (id): user id. Available for user_list and
188                 user_summary.
189
190                 files (count): number of files. Available everywhere.
191
192                 dirname (string): name of the directory. Available
193                 for user_list and global_list.
194
195                 size (size): total size/ directory size. Available
196                 everywhere.
197
198                 dirs (count): number of directories. Available
199                 for user_summary and global_summary.
200 "