/[baselayout]/trunk/src/mountinfo.c
Gentoo

Diff of /trunk/src/mountinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2803 Revision 2865
157 157
158 return (reg); 158 return (reg);
159} 159}
160 160
161#include "_usage.h" 161#include "_usage.h"
162#define getoptstring "f:F:n:N:p:P:os" getoptstring_COMMON 162#define getoptstring "f:F:n:N:op:P:qs" getoptstring_COMMON
163static struct option longopts[] = { 163static struct option longopts[] = {
164 { "fstype-regex", 1, NULL, 'f'}, 164 { "fstype-regex", 1, NULL, 'f'},
165 { "skip-fstype-regex", 1, NULL, 'F'}, 165 { "skip-fstype-regex", 1, NULL, 'F'},
166 { "node-regex", 1, NULL, 'n'}, 166 { "node-regex", 1, NULL, 'n'},
167 { "skip-node-regex", 1, NULL, 'N'}, 167 { "skip-node-regex", 1, NULL, 'N'},
168 { "point-regex", 1, NULL, 'p'}, 168 { "point-regex", 1, NULL, 'p'},
169 { "skip-point-regex", 1, NULL, 'P'}, 169 { "skip-point-regex", 1, NULL, 'P'},
170 { "node", 0, NULL, 'o'}, 170 { "node", 0, NULL, 'o'},
171 { "fstype", 0, NULL, 's'}, 171 { "fstype", 0, NULL, 's'},
172 { "quiet", 0, NULL, 'q'},
172 longopts_COMMON 173 longopts_COMMON
173 { NULL, 0, NULL, 0} 174 { NULL, 0, NULL, 0}
174}; 175};
175#include "_usage.c" 176#include "_usage.c"
176 177
187 char *n; 188 char *n;
188 bool node = false; 189 bool node = false;
189 bool fstype = false; 190 bool fstype = false;
190 char **mounts = NULL; 191 char **mounts = NULL;
191 int opt; 192 int opt;
193 bool quiet = false;
192 int result; 194 int result;
193 195
194#define DO_REG(_var) \ 196#define DO_REG(_var) \
195 if (_var) free (_var); \ 197 if (_var) free (_var); \
196 _var = get_regex (optarg); 198 _var = get_regex (optarg);
209 DO_REG (node_regex); 211 DO_REG (node_regex);
210 break; 212 break;
211 case 'N': 213 case 'N':
212 DO_REG (skip_node_regex); 214 DO_REG (skip_node_regex);
213 break; 215 break;
214 case 'p':
215 DO_REG (point_regex);
216 break;
217 case 'P':
218 DO_REG (skip_point_regex);
219 break;
220 case 'o': 216 case 'o':
221 node = true; 217 node = true;
222 fstype = false; 218 fstype = false;
219 break;
220 case 'p':
221 DO_REG (point_regex);
222 break;
223 case 'P':
224 DO_REG (skip_point_regex);
225 break;
226 case 'q':
227 quiet = true;
223 break; 228 break;
224 case 's': 229 case 's':
225 node = false; 230 node = false;
226 fstype = true; 231 fstype = true;
227 break; 232 break;
255 STRLIST_FOREACH (nodes, n, i) { 260 STRLIST_FOREACH (nodes, n, i) {
256 if (point_regex && regexec (point_regex, n, 0, NULL, 0) != 0) 261 if (point_regex && regexec (point_regex, n, 0, NULL, 0) != 0)
257 continue; 262 continue;
258 if (skip_point_regex && regexec (skip_point_regex, n, 0, NULL, 0) == 0) 263 if (skip_point_regex && regexec (skip_point_regex, n, 0, NULL, 0) == 0)
259 continue; 264 continue;
265 if (! quiet)
260 printf ("%s\n", n); 266 printf ("%s\n", n);
261 result = EXIT_SUCCESS; 267 result = EXIT_SUCCESS;
262 } 268 }
263 rc_strlist_free (nodes); 269 rc_strlist_free (nodes);
264 270
265 if (point_regex) 271 if (point_regex)

Legend:
Removed from v.2803  
changed lines
  Added in v.2865

  ViewVC Help
Powered by ViewVC 1.1.20