Debian Codegraph @

upstream/opensuse-leap-16-1/man7/dnf5-aliases.7

raw
1 .\" Man page generated from reStructuredText.
2 .
3 .
4 .nr rst2man-indent-level 0
5 .
6 .de1 rstReportMargin
7 \\$1 \\n[an-margin]
8 level \\n[rst2man-indent-level]
9 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10 -
11 \\n[rst2man-indent0]
12 \\n[rst2man-indent1]
13 \\n[rst2man-indent2]
14 ..
15 .de1 INDENT
16 .\" .rstReportMargin pre:
17 . RS \\$1
18 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19 . nr rst2man-indent-level +1
20 .\" .rstReportMargin post:
21 ..
22 .de UNINDENT
23 . RE
24 .\" indent \\n[an-margin]
25 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26 .nr rst2man-indent-level -1
27 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29 ..
30 .TH "DNF5-ALIASES" "7" "Apr 29, 2025" "" "dnf5"
31 .SH NAME
32 dnf5-aliases \- Aliases for command line arguments
33 .SH DESCRIPTION
34 .sp
35 It is possible to define custom aliases which can be then used as dnf commands or options to abbreviate longer
36 command and option sequences.
37 .sp
38 The aliases can be configured in the toml format and the configuration files are taken from these drop\-in
39 directories:
40 .INDENT 0.0
41 .INDENT 3.5
42 .INDENT 0.0
43 .IP \(bu 2
44 \fB/usr/share/dnf5/aliases.d/\fP
45 .IP \(bu 2
46 \fB/etc/dnf/dnf5\-aliases.d/\fP
47 .IP \(bu 2
48 \fB$XDG_CONFIG_HOME/dnf5/aliases.d/\fP
49 .UNINDENT
50 .UNINDENT
51 .UNINDENT
52 .SS Syntax:
53 .sp
54 Configuration file must begin with the attribute \fBversion\fP with a value of a supported version, for example:
55 .INDENT 0.0
56 .INDENT 3.5
57 .sp
58 .EX
59 version = \(aq1.0\(aq
60 .EE
61 .UNINDENT
62 .UNINDENT
63 .sp
64 Each alias is defined in a separate section, using \fBkey = value\fP pairs, for example:
65 .INDENT 0.0
66 .INDENT 3.5
67 .sp
68 .EX
69 [\(aqin\(aq]
70 type = \(aqcommand\(aq
71 attached_command = \(aqinstall\(aq
72 descr = \(dqAlias for \(aqinstall\(aq\(dq
73 .EE
74 .UNINDENT
75 .UNINDENT
76 .sp
77 The section name uniquely identifies the alias. It is in a form of a path, i.e. one or more strings separated by dots,
78 which defines the scope of the alias. For example, string \(dqgroup.list.in\(dq would identify an alias usable only within
79 the scope of the group list subcommand.
80 .sp
81 There are the following types of aliases:
82 .INDENT 0.0
83 .INDENT 3.5
84 .INDENT 0.0
85 .IP \(bu 2
86 \fI\%command\fP
87 .IP \(bu 2
88 \fI\%cloned_named_arg\fP
89 .IP \(bu 2
90 \fI\%named_arg\fP
91 .IP \(bu 2
92 \fI\%group\fP
93 .UNINDENT
94 .UNINDENT
95 .UNINDENT
96 .SS Type: command
97 .sp
98 The \fBcommand\fP alias defines an alias for a command.
99 .INDENT 0.0
100 .TP
101 .B Keys:
102 .INDENT 7.0
103 .IP \(bu 2
104 \fBtype\fP \- Must have value \fBcommand\fP\&.
105 .IP \(bu 2
106 \fBattached_command\fP \- Path to a command for which this alias is defined.
107 .IP \(bu 2
108 \fBdescr\fP \- Description that will be shown in help.
109 .IP \(bu 2
110 \fBgroup_id\fP \- A group this alias is part of if any.
111 .IP \(bu 2
112 \fBcomplete\fP \- Whether bash autocompletion should be used for this alias, default is false.
113 .IP \(bu 2
114 \fBattached_named_args\fP \- Options that will be used with the command. The format is an array of inline
115 tables, each of which must contain an \fBid_path\fP key to specify the path to an option, and may contain also
116 a \fBvalue\fP key to specify the value of the option.
117 .UNINDENT
118 .UNINDENT
119 .sp
120 The required keys are \fBtype\fP, and \fBattached_command\fP\&.
121 .INDENT 0.0
122 .TP
123 .B Examples:
124 .INDENT 7.0
125 .IP \(bu 2
126 Alias \fBgrouplist\fP for \fBgroup list\fP:
127 .INDENT 2.0
128 .INDENT 3.5
129 .sp
130 .EX
131 [\(aqgrouplist\(aq]
132 type = \(aqcommand\(aq
133 attached_command = \(aqgroup.list\(aq
134 descr = \(dqAlias for \(aqgroup list\(aq\(dq
135 .EE
136 .UNINDENT
137 .UNINDENT
138 .IP \(bu 2
139 Alias \fBgroup.ls\fP for \fBgroup list\fP:
140 .INDENT 2.0
141 .INDENT 3.5
142 .sp
143 .EX
144 [\(aqgroup.ls\(aq]
145 type = \(aqcommand\(aq
146 attached_command = \(aqgroup.list\(aq
147 descr = \(dqAlias for \(aqgroup list\(aq\(dq
148 complete = true
149 .EE
150 .UNINDENT
151 .UNINDENT
152 .IP \(bu 2
153 Alias \fBlist\-fedora\-all\fP for \fB\-\-repo=fedora list \-\-showduplicates\fP:
154 .INDENT 2.0
155 .INDENT 3.5
156 .sp
157 .EX
158 [\(aqlist\-fedora\-all\(aq]
159 type = \(aqcommand\(aq
160 attached_command = \(aqlist\(aq
161 descr = \(dqAlias for \(aq\-\-repo=fedora list \-\-showduplicates\(aq\(dq
162 complete = true
163 attached_named_args = [
164 { id_path = \(aqrepo\(aq, value = \(aqfedora\(aq },
165 { id_path = \(aqlist.showduplicates\(aq }
166 ]
167 .EE
168 .UNINDENT
169 .UNINDENT
170 .UNINDENT
171 .UNINDENT
172 .SS Type: cloned_named_arg
173 .sp
174 The \fBcloned_named_arg\fP alias defines another name for a given option.
175 .INDENT 0.0
176 .TP
177 .B Keys:
178 .INDENT 7.0
179 .IP \(bu 2
180 \fBtype\fP \- Must have value \fBcloned_named_arg\fP\&.
181 .IP \(bu 2
182 \fBlong_name\fP \- Name of the alias option.
183 .IP \(bu 2
184 \fBshort_name\fP \- One\-letter shortcut of the name.
185 .IP \(bu 2
186 \fBsource\fP \- Path to the option for which this alias is defined.
187 .IP \(bu 2
188 \fBgroup_id\fP \- A group this alias is part of if any.
189 .IP \(bu 2
190 \fBcomplete\fP \- Whether bash autocompletion should be used for this alias, default is false.
191 .UNINDENT
192 .UNINDENT
193 .sp
194 The required keys are \fBtype\fP, either \fBlong_name\fP or \fBshort_name\fP, and \fBsource\fP\&.
195 .INDENT 0.0
196 .TP
197 .B Examples:
198 .INDENT 7.0
199 .IP \(bu 2
200 Alias \fB\-\-nobest\fP for \fB\-\-no\-best\fP:
201 .INDENT 2.0
202 .INDENT 3.5
203 .sp
204 .EX
205 [\(aqnobest\(aq]
206 type = \(aqcloned_named_arg\(aq
207 long_name = \(aqnobest\(aq
208 source = \(aqno\-best\(aq
209 .EE
210 .UNINDENT
211 .UNINDENT
212 .IP \(bu 2
213 Alias \fBrepoquery \-\-list\fP or \fBrepoquery \-l\fP for \fBrepoquery \-\-files\fP:
214 .INDENT 2.0
215 .INDENT 3.5
216 .sp
217 .EX
218 [\(aqrepoquery.list\(aq]
219 type = \(aqcloned_named_arg\(aq
220 long_name = \(aqlist\(aq
221 short_name = \(aql\(aq
222 source = \(aqrepoquery.files\(aq
223 .EE
224 .UNINDENT
225 .UNINDENT
226 .UNINDENT
227 .UNINDENT
228 .SS Type: named_arg
229 .sp
230 The \fBnamed_arg\fP defines an alias that can replace multiple options and can define a value for each.
231 .INDENT 0.0
232 .TP
233 .B Keys:
234 .INDENT 7.0
235 .IP \(bu 2
236 \fBtype\fP \- Must have value \fBnamed_arg\fP\&.
237 .IP \(bu 2
238 \fBlong_name\fP \- Name of the alias option.
239 .IP \(bu 2
240 \fBshort_name\fP \- One\-letter shortcut of the name.
241 .IP \(bu 2
242 \fBdescr\fP \- Description that will be shown in help.
243 .IP \(bu 2
244 \fBhas_value\fP \- Whether the option requires a value. The value is then substituted for \fB${}\fP strings in the
245 values of \fBattached_named_args\fP\&. Default is false.
246 .IP \(bu 2
247 \fBvalue_help\fP \- The string shown in help for the value (e.g. \fBCONFIG_FILE_PATH\fP for
248 \fB\-\-config=CONFIG_FILE_PATH\fP).
249 .IP \(bu 2
250 \fBconst_value\fP \- Default constant value (specified only if the alias does not have a value on the command line).
251 The value is then substituted for \fB${}\fP strings in the values of \fBattached_named_args\fP\&.
252 .IP \(bu 2
253 \fBgroup_id\fP \- A group this alias is part of if any.
254 .IP \(bu 2
255 \fBcomplete\fP \- Whether bash autocompletion should be used for this alias, default is false.
256 .IP \(bu 2
257 \fBattached_named_args\fP \- Options that will be used. The format is an array of inline tables, each of which must
258 contain an \fBid_path\fP key to specify the path to an option, and may contain also a \fBvalue\fP key to specify the
259 value of the option.
260 .UNINDENT
261 .UNINDENT
262 .sp
263 The required keys are \fBtype\fP, and either \fBlong_name\fP or \fBshort_name\fP\&.
264 .INDENT 0.0
265 .TP
266 .B Examples:
267 .INDENT 7.0
268 .IP \(bu 2
269 Alias \fBlist \-\-all\-available\fP for \fBlist \-\-showduplicates \-\-available\fP:
270 .INDENT 2.0
271 .INDENT 3.5
272 .sp
273 .EX
274 [\(aqlist.all\-available\(aq]
275 type = \(aqnamed_arg\(aq
276 long_name = \(aqall\-available\(aq
277 attached_named_args = [
278 { id_path = \(aqlist.showduplicates\(aq },
279 { id_path = \(aqlist.available\(aq }
280 ]
281 .EE
282 .UNINDENT
283 .UNINDENT
284 .IP \(bu 2
285 Alias \fBdownload \-\-dest=DESTDIR\fP for \fBdownload \-\-destdir=DESTDIR\fP:
286 .INDENT 2.0
287 .INDENT 3.5
288 .sp
289 .EX
290 [\(aqdownload.dest\(aq]
291 type = \(aqnamed_arg\(aq
292 long_name = \(aqdest\(aq
293 has_value = true
294 value_help = \(aqDESTDIR\(aq
295 attached_named_args = [
296 { id_path = \(aqdownload.destdir\(aq }
297 ]
298 .EE
299 .UNINDENT
300 .UNINDENT
301 .IP \(bu 2
302 Alias \fB\-\-settsflags=TS_FLAGS\fP for \fB\-\-setopt=tsflags=TS_FLAGS\fP:
303 .INDENT 2.0
304 .INDENT 3.5
305 .sp
306 .EX
307 [\(aqsettsflags\(aq]
308 type = \(aqnamed_arg\(aq
309 long_name = \(aqsettsflags\(aq
310 descr = \(aqSet transaction flags\(aq
311 has_value = true
312 value_help = \(aqTS_FLAGS\(aq
313 attached_named_args = [
314 { id_path = \(aqsetopt\(aq, value = \(aqtsflags=${}\(aq }
315 ]
316 .EE
317 .UNINDENT
318 .UNINDENT
319 .UNINDENT
320 .UNINDENT
321 .SS Type: group
322 .sp
323 The \fBgroup\fP defines a group for multiple commands or options.
324 .INDENT 0.0
325 .TP
326 .B Required keys:
327 .INDENT 7.0
328 .IP \(bu 2
329 \fBtype\fP \- Must have value \fBgroup\fP\&.
330 .IP \(bu 2
331 \fBheader\fP \- The header of the group as will be shown in help.
332 .UNINDENT
333 .UNINDENT
334 .sp
335 The required keys are \fBtype\fP and \fBheader\fP\&.
336 .sp
337 The aliases are added to the group using the \fBgroup_id\fP key in their respective sections.
338 .INDENT 0.0
339 .TP
340 .B Examples:
341 .INDENT 7.0
342 .IP \(bu 2
343 Group \fBquery\-aliases\fP for subcommand \fBrepo\fP containing aliases \fBrepo.ls\fP and \fBrepo.if\fP:
344 .INDENT 2.0
345 .INDENT 3.5
346 .sp
347 .EX
348 [\(aqrepo.query\-aliases\(aq]
349 type = \(aqgroup\(aq
350 header = \(aqQuery Aliases:\(aq
351
352 [\(aqrepo.ls\(aq]
353 type = \(aqcommand\(aq
354 attached_command = \(aqrepo.list\(aq
355 descr = \(dqAlias for \(aqrepo list\(aq\(dq
356 group_id = \(aqquery\-aliases\(aq
357
358 [\(aqrepo.if\(aq]
359 type = \(aqcommand\(aq
360 attached_command = \(aqrepo.info\(aq
361 descr = \(dqAlias for \(aqrepo info\(aq\(dq
362 group_id = \(aqquery\-aliases\(aq
363 .EE
364 .UNINDENT
365 .UNINDENT
366 .UNINDENT
367 .UNINDENT
368 .SH AUTHOR
369 See AUTHORS.md in dnf5 source distribution.
370 .SH COPYRIGHT
371 Contributors to the dnf5 project.
372 .\" Generated by docutils manpage writer.
373 .