Fix prototype of com_create().
[adu.git] / adu.ggo
1 # Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
2 #
3 # Licensed under the GPL v2. For licencing details see COPYING.
4
5 package "adu"
6 purpose "advanced disk usage
7
8 adu creates a database containing disk usage statistics of a given
9 directory. It allows to query that database to quickly retrieve
10 usage patterns of subdirectories and/or files owned by a given user id.
11 "
12
13 #########################
14 section "General options"
15 #########################
16
17 option "config-file" c
18 #~~~~~~~~~~~~~~~~~~~~~
19 "(default='~/.adurc')"
20 string typestr="filename"
21 optional
22 details="
23 Options may be given at the command line or in the
24 configuration file. As usual, if an option is given both at
25 the command line and in the configuration file, the command
26 line option takes precedence.
27
28 "
29
30 option "database-dir" d
31 #~~~~~~~~~~~~~~~~~~~~~~
32 "directory containing the osl tables"
33 string typestr="path"
34 required
35 details="
36 Full path to the directory containing the osl tables. This
37 directory must exist. It must be writable for the user running
38 adu in --create mode and readable in --select mode.
39
40 "
41 option "loglevel" l
42 #~~~~~~~~~~~~~~~~~~
43 "Set loglevel (0-6)"
44 int typestr="level"
45 default="3"
46 optional
47 details="
48 Log messages are always written to stderr while normal output
49 goes to stdout. Lower values mean more verbose logging.
50 "
51
52 option "uid" u
53 #~~~~~~~~~~~~~
54 "user id(s) to take into account"
55 string typestr="uid_spec"
56 optional
57 multiple
58 details="
59 An uid specifier may be a single number, or a range of uids.
60 Example:
61
62 --uid 42 # only consider uid 42
63 --uid 42- # only consider uids greater or equal than 42
64 --uid 23-42 # only consider uids between 23 and 42, inclusively.
65
66 This option may be given multiple times. An uid is taken into
67 account if it satisfies at least one --uid option.
68 "
69
70
71 option "paths" p
72 #~~~~~~~~~~~~~~~
73 "files to take into account"
74 string typestr="pattern"
75 optional
76 details="
77 Shell wildcard pattern that must match a file in order to be
78 included in the database in --create mode or in the output
79 for --select mode. Only the part of the filename below the
80 base directory is matched against the pattern. The default
81 is to take all files into account. See fnmatch(3) for details.
82 "
83
84 ###############
85 section "Modes"
86 ###############
87
88 defgroup "mode"
89 #==============
90 groupdesc="
91 adu may be started in one of two possible modes, each of which
92 corresponds to a different command line option. Exactly one
93 of these options must be given.
94
95 "
96 required
97
98 groupoption "create" C
99 #~~~~~~~~~~~~~~~~~~~~~
100 "Create a new database"
101 group="mode"
102 details="
103 Traverse the given directory and track disk user on a per-user
104 basis. Results are stored in N + 1 osl tables where N is
105 the number of uids that own at least one regular file in
106 that directory.
107 "
108
109 groupoption "interactive" I
110 #~~~~~~~~~~~~~~~~~~~~~
111 "activate interactive mode"
112 group="mode"
113 details="
114 In this mode, adu reads commands from stdin.
115 "
116
117 groupoption "select" S
118 #~~~~~~~~~~~~~~~~~~~~~
119 "query a database previously created with --create"
120 group="mode"
121 details="
122 This option prints statistics about matching subdirectories to
123 stdout. The output depends on the other options, see below.
124 "
125
126 ##############################
127 section "Options for --create"
128 ##############################
129
130 option "base-dir" b
131 #~~~~~~~~~~~~~~~~~~
132 "directory to traverse"
133 string typestr="path"
134 dependon="create"
135 optional
136 details="
137 The base directory to be traversed recursively. Must be
138 given if --create mode was selected. A warning message is
139 printed for each subdirectory that could not be read because
140 of insufficient permission. These directories will be ignored
141 when computing statistics.
142 "
143
144 option "one-file-system" x
145 #~~~~~~~~~~~~~~~~~~~~~~~~~
146 "do not dive into other file systems"
147 flag off
148 dependon="create"
149 details="
150 Skip directories that are on different filesystems from the
151 one that the argument being processed is on.
152 "
153
154 option "hash-table-bits" -
155 #~~~~~~~~~~~~~~~~~~~~~~~~~
156 "specify the size of the uid hash table"
157 int typestr="num"
158 dependon="create"
159 default="10"
160 optional
161 details="
162 Use a hash table of size 2^num for the uid entries. If more than
163 2^num different uids own at least one regular file under base-dir,
164 the command fails. Increase this value if you have more than 1024
165 users. Decreasing the value causes adu to use slightly less memory.
166 "
167
168 ##############################
169 section "Options for --select"
170 ##############################
171
172 option "limit" L
173 #~~~~~~~~~~~~~~~
174 "Limit output"
175 int typestr="num"
176 default="-1"
177 optional
178 dependon="select"
179 details="
180 Only print num lines of output. If negative (the default),
181 print all lines.
182 "
183
184 option "size-unit" -
185 #~~~~~~~~~~~~~~~~~~~
186 "select output format for sizes"
187 enum typestr="format"
188 values="h","b","k","m","g","t"
189 default="h"
190 optional
191 dependon="select"
192 details="
193 Print sizes in the given unit: human-readable, bytes,
194 kilobytes (2^10), megabytes (2^20), gigabytes (2^30), terabytes
195 (2^40). The default is \"h\", i.e. human-readable.
196 "
197
198 option "count-unit" -
199 #~~~~~~~~~~~~~~~~~~~~
200 "select output format for counted values"
201 enum typestr="format"
202 values="h","n","k","m","g","t"
203 default="h"
204 optional
205 dependon="select"
206 details="
207 Print the number of files/directories in the given unit:
208 human-readable, number, number/10^3, number/10^6, number/10^12,
209 number/10^15. The default is to print numbers in human-readable
210 format.
211 "
212
213 option "print-base-dir" -
214 #~~~~~~~~~~~~~~~~~~~~~~~~
215 "whether to include the base-dir in the output"
216 flag off
217 details="
218 If this flag is given, all directories printed are prefixed
219 with the base directory. The default is to print paths relative
220 to the base dir.
221 "
222
223 option "no-headers" -
224 #~~~~~~~~~~~~~~~~~~~~
225 "supress descriptions for listings/tables"
226 flag off
227 dependon="select"
228 details="
229 This is mostly useful to feed the output of adu to scripts.
230 "
231
232 option "global-list" -
233 #~~~~~~~~~~~~~~~~~~~~~
234 "how to print global directory listings"
235 enum typestr="which"
236 values="size","file_count","both","none"
237 default="both"
238 optional
239 dependon="select"
240 details="
241 By default adu prints two global directory listings: The
242 first prints the directory names ordered by the sum of the
243 sizes of the contained files while the second listing prints
244 them sorted by the number of files. This option can be used
245 to print only one or neither of these two listings.
246 "
247
248 option "no-global-summary" -
249 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
250 "do not print the summary line"
251 flag off
252 dependon="select"
253
254 option "user-list" -
255 #~~~~~~~~~~~~~~~~~~~
256 "how to print per-user directory listings"
257 enum typestr="which"
258 values="size","file_count","both","none"
259 default="both"
260 optional
261 dependon="select"
262 details="
263 Similar to the global directory listings mentioned above,
264 adu can print two directory listings per user. This option
265 controls which of the these should be printed.
266 "
267
268 option "no-user-summary" -
269 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
270 "do not print the user summary table"
271 flag off
272 dependon="select"
273
274
275 option "user-summary-sort" -
276 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
277 "how to sort the user-summary"
278 enum typestr="col_spec"
279 values="name","uid","dir_count","file_count","size"
280 default="size"
281 optional
282 dependon="select"
283 details="
284 It is enough to specify the first letter of the column specifier,
285 e.g. \"--user-summary-sort f\" sorts by file count.
286 "