Allow comments in interactive input.
[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 "paths" p
53 #~~~~~~~~~~~~~~~
54 "files to take into account"
55 string typestr="pattern"
56 optional
57 details="
58         Shell wildcard pattern that must match a file in order to be
59         included in the database in --create mode or in the output
60         for --select mode. Only the part of the filename below the
61         base directory is matched against the pattern. The default
62         is to take all files into account. See fnmatch(3) for details.
63 "
64
65 ###############
66 section "Modes"
67 ###############
68
69 defgroup "mode"
70 #==============
71 groupdesc="
72         adu may be started in one of three possible modes, each of
73         which corresponds to a different command line option. Exactly
74         one of these options must be given.
75
76 "
77 required
78
79 groupoption "create" C
80 #~~~~~~~~~~~~~~~~~~~~~
81 "Create a new database"
82 group="mode"
83 details="
84         Traverse the given directory and track disk user on a per-user
85         basis. Results are stored in N + 1 osl tables where N is
86         the number of uids that own at least one regular file in
87         that directory.
88 "
89
90 groupoption "interactive" I
91 #~~~~~~~~~~~~~~~~~~~~~~~~~~
92 "activate interactive mode"
93 group="mode"
94 details="
95         In this mode, adu reads commands from stdin.  This makes it
96         possible to run different select queries without opening the
97         underlying osl database for each query (which is expensive).
98 "
99
100 groupoption "select" S
101 #~~~~~~~~~~~~~~~~~~~~~
102 "query a database previously created with --create"
103 group="mode"
104 details="
105         This option prints statistics about matching subdirectories
106         to stdout. The output can be customized by specifying select
107         options, see below.
108 "
109
110 ##############################
111 section "Options for --create"
112 ##############################
113
114 option "base-dir" b
115 #~~~~~~~~~~~~~~~~~~
116 "directory to traverse"
117 string typestr="path"
118 dependon="create"
119 optional
120 details="
121         The base directory to be traversed recursively. Must be
122         given if --create mode was selected. A warning message is
123         printed for each subdirectory that could not be read because
124         of insufficient permission. These directories will be ignored
125         when computing statistics.
126 "
127
128 option "one-file-system" x
129 #~~~~~~~~~~~~~~~~~~~~~~~~~
130 "do not dive into other file systems"
131 flag off
132 dependon="create"
133 details="
134         Skip directories that are on different filesystems from the
135         one that the argument being processed is on.
136 "
137
138 option "hash-table-bits" -
139 #~~~~~~~~~~~~~~~~~~~~~~~~~
140 "specify the size of the uid hash table"
141 int typestr="num"
142 dependon="create"
143 default="10"
144 optional
145 details="
146         Use a hash table of size 2^num for the uid entries. If more than
147         2^num different uids own at least one regular file under base-dir,
148         the command fails. Increase this value if you have more than 1024
149         users. Decreasing the value causes adu to use slightly less memory.
150 "
151
152 ##############################
153 section "Options for --select"
154 ##############################
155
156 option "select-options" s
157 #~~~~~~~~~~~~~~~~~~~~~~~~~
158 "Options for select mode"
159 string typestr="<options>"
160 optional
161 dependon="select"
162 details="
163         This option takes a string whose content is another set of
164         options as described below.  Select options may be specified
165         either directly in select mode, in which case you have to quote
166         them to prevent them from being interpreted as adu options,
167         or via the \"set\" command in interactive mode.
168 "