Bump to 1.14.1
[platform/upstream/augeas.git] / man / augmatch.pod
1 =head1 NAME
2
3 augmatch - inspect and match contents of configuration files
4
5 =head1 SYNOPSIS
6
7 augmatch [OPTIONS] FILE
8
9 =head1 DESCRIPTION
10
11 B<augmatch> prints the tree that Augeas generates by parsing a
12 configuration file, or only those parts of the tree that match a certain
13 path expression. Parsing is controlled by lenses, many of which ship with
14 Augeas. B<augmatch> to select the correct lens for a given file
15 automatically unless one is specified with the B<--lens> option.
16
17 =head1 OPTIONS
18
19 =over 4
20
21 =item B<-a>, B<--all>
22
23 Print all tree nodes, even ones without an associated value. Without this
24 flag, augmatch omits these nodes from the output as they are usually
25 uninteresting.
26
27 =item B<-e>, B<--exact>
28
29 Only print the parts of the tree that exactly match the expression provided
30 with B<--match> and not any of the descendants of matching nodes.
31
32 =item B<-I>, B<--include>=I<DIR>
33
34 Add DIR to the module loadpath. Can be given multiple times. The
35 directories set here are searched before any directories specified in the
36 AUGEAS_LENS_LIB environment variable, and before the default directories
37 F</usr/share/augeas/lenses> and F</usr/share/augeas/lenses/dist>.
38
39 =item B<-l>, B<--lens>=I<LENS>
40
41 Use LENS for the given file; without this option, B<augmatch> tries to
42 guess the lens for the file based on the file's name and path which only
43 works for files in standard locations.
44
45 =item B<-L>, B<--print-lens>
46
47 Print the name of the lens that will be used with the given file and exit.
48
49 =item B<-m>, B<--match>=I<EXPR>
50
51 Only print the parts of the tree that match the path expression EXPR. All
52 nodes that match EXPR and their descendants will be printed. Use L<--exact>
53 to print only matching nodes but no descendants.
54
55 =item B<-r>, B<--root>=I<ROOT>
56
57 Use directory ROOT as the root of the filesystem. Takes precedence over a
58 root set with the AUGEAS_ROOT environment variable.
59
60 =item B<-S>, B<--nostdinc>
61
62 Do not search any of the default directories for lenses. When this option
63 is set, only directories specified explicitly with B<-I> or specified in
64 B<AUGEAS_LENS_LIB> will be searched for modules.
65
66 =item B<-o>, B<--only-value>
67
68 Print only the value and not the label or the path of nodes.
69
70 =item B<-q>, B<--quiet>
71
72 Do not print anything. Exit with zero status if a match was found
73
74 =back
75
76 =head1 ENVIRONMENT VARIABLES
77
78 =over 4
79
80 =item B<AUGEAS_ROOT>
81
82 The file system root, defaults to '/'. Can be overridden with
83 the B<-r> command line option
84
85 =item B<AUGEAS_LENS_LIB>
86
87 Colon separated list of directories with lenses. Directories specified here
88 are searched after any directories set with the B<-I> command line option,
89 but before the default directories F</usr/share/augeas/lenses> and
90 F</usr/share/augeas/lenses/dist>
91
92 =back
93
94 =head1 EXAMPLES
95
96   # print the tree for /etc/exports
97   augmatch /etc/exports
98
99   # show only the entry for a specific mount
100   augmatch -m 'dir["/home"]' /etc/exports
101
102   # show all the clients to which we are exporting /home
103   augmatch -eom 'dir["/home"]/client' /etc/exports
104
105 =head1 EXIT STATUS
106
107 The exit status is 0 when there was at least one match, 1 if there was no
108 match, and 2 if an error occurred.
109
110 =head1 FILES
111
112 Lenses and schema definitions in F</usr/share/augeas/lenses> and
113 F</usr/share/augeas/lenses/dist>
114
115 =head1 AUTHOR
116
117 David Lutterkort <lutter@watzmann.net>
118
119 =head1 COPYRIGHT AND LICENSE
120
121 Copyright 2007-2018 David Lutterkort
122
123 Augeas (and augmatch) are distributed under the GNU Lesser General Public
124 License (LGPL)
125
126 =head1 SEE ALSO
127
128 B<Augeas> project homepage L<http://www.augeas.net/>
129
130 B<Augeas> path expressions L<https://github.com/hercules-team/augeas/wiki/Path-expressions>
131
132 L<augprint>