Skip to content

Commit 8d2cb84

Browse files
authored
Merge pull request #217 from StyleGuides/daobrien/216-continuation-prompts
#216 continuation prompts
2 parents 93563e7 + 5f706a6 commit 8d2cb84

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

en-US/Book_Info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>Conventions for Writers and Editors</title>
88
<productname>The Red Hat Style Guide</productname>
99
<productnumber></productnumber>
10-
<edition>4</edition>
10+
<edition>4.2</edition>
1111
<pubsnumber>1</pubsnumber>
1212
<abstract>
1313
<para>

en-US/Design.xml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,12 @@
260260
Avoid using the <option>--force (-f)</option> and <option>--assumeyes (-y)</option> options on most commands, especially when logged in as the <systemitem>root</systemitem> user. This can lead to unintended consequences, such as removing files or directories by mistake or installing packages or other software that may not suit your system. Refer to the following examples:
261261
</para>
262262

263-
<screen>[root@serverc pam.d]# rm -f system-auth password-auth (omit the -f)
264-
[root@serverc ~]# yum install -y new-package (omit the -y)
263+
<screen>[root@serverc pam.d]# rm -f system-auth password-auth
264+
[root@serverc ~]# yum install -y new-package
265265
</screen>
266+
<para>
267+
In the examples shown above, omit the <option>-f</option> and <option>-y</option> options, respectively.
268+
</para>
266269
<para>
267270
In some cases, such as in Ansible Playbooks or other automation scripts, it may be necessary to use these options.
268271
</para>
@@ -282,23 +285,55 @@ $ vi myFile.txt
282285

283286
</example>
284287
<para>
285-
If the commands are long, complex, or wrap over multiple lines, use the following design to help optimize clarity.
286-
If you are documenting commands on a different operating system, update the prompts and line continuation characters to suit.
287-
</para>
288+
If the commands are long, complex, or wrap over multiple lines, two design options are available.
289+
</para>
290+
<itemizedlist>
291+
<listitem>
292+
<para>
293+
Use line continuation characters and the associated PS2 prompts.
294+
If you are documenting commands on a different operating system, update the prompts and line continuation characters to suit.
295+
</para>
296+
</listitem>
297+
<listitem>
298+
<para>
299+
Use neither line continuation characters nor the associated PS2 prompts.
300+
</para>
301+
</listitem>
302+
</itemizedlist>
303+
<important>
304+
<para>
305+
Do not mix these two styles.
306+
Maintain the same style throughout your document or book.
307+
</para>
308+
</important>
309+
<para>
310+
You can also indent the second and subsequent lines of such commands to assist in clarity and readability if required.
311+
You can use this option for either of the two designs mentioned above.
312+
</para>
313+
288314
<example>
289-
<title>Documenting Long Commands</title>
315+
<title>Wrapping Long Commands with Continuation Characters</title>
316+
<para>
317+
This example uses both continuation characters and PS2 prompts.
318+
These indicators are always used together.
319+
</para>
290320

291321
<screen># tar --selinux -czvf config_files.tar.gz /etc/katello \
292322
> /etc/elasticsearch /etc/candlepin /etc/pulp /etc/gofer \
293323
> /etc/grinder /etc/pki/katello /etc/pki/pulp /etc/qpidd.conf \
294324
> /etc/sysconfig/katello /etc/sysconfig/elasticsearch \
295-
> /root/ssl–build /var/www/html/pub/* /var/lib/katello
325+
> /root/ssl–build /var/www/html/pub/* /var/lib/katello</screen>
326+
</example>
296327

297-
# cd /var/lib/katello
328+
<example><title>Wrapping Long Commands Without Continuation Characters</title>
329+
<para>
330+
This example uses neither continuation characters nor PS2 prompts, but it does demonstrate how to use line indentation to help clarify long commands.
331+
</para>
332+
<screen># cd /var/lib/katello
298333

299-
# myCommand --option funky --color=true \
300-
> --config_file=&lt;replaceable&gt;/home/user/config.conf&lt;/replaceable&gt; \
301-
> --output_file=&lt;replaceable&gt;/home/user/output.txt&lt;/replaceable&gt;</screen>
334+
# myCommand --option funky --color=true
335+
--config_file=&lt;replaceable&gt;/home/user/config.conf&lt;/replaceable&gt;
336+
--output_file=&lt;replaceable&gt;/home/user/output.txt&lt;/replaceable&gt;</screen>
302337

303338
</example>
304339

0 commit comments

Comments
 (0)