mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Wrap with multiline shell conditionals
This commit is contained in:
parent
1b206ee362
commit
be87f493ae
14
shell.xml
14
shell.xml
|
@ -360,9 +360,21 @@ Revision 1.26
|
||||||
<STYLEPOINT title="Loops">
|
<STYLEPOINT title="Loops">
|
||||||
<SUMMARY>
|
<SUMMARY>
|
||||||
Put <code>; do</code> and <code>; then</code> on the same line as the
|
Put <code>; do</code> and <code>; then</code> on the same line as the
|
||||||
<code>while</code>, <code>for</code> or <code>if</code>.
|
<code>while</code>, <code>for</code> or <code>if</code>, unless the line
|
||||||
|
exceeds the maximum line length.
|
||||||
</SUMMARY>
|
</SUMMARY>
|
||||||
<BODY>
|
<BODY>
|
||||||
|
<p>
|
||||||
|
Example:
|
||||||
|
<CODE_SNIPPET>
|
||||||
|
if [[ -d "${LONG_PATH_TO_DIRECTORY}" && \
|
||||||
|
-f "${LONG_PATH_TO_FILE}" && \
|
||||||
|
! check_something ]]
|
||||||
|
then
|
||||||
|
delete_all_oracle_databases
|
||||||
|
fi
|
||||||
|
</CODE_SNIPPET>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Loops in shell are a bit different, but we follow the same principles
|
Loops in shell are a bit different, but we follow the same principles
|
||||||
as with braces when declaring functions. That is: <code>; then</code>
|
as with braces when declaring functions. That is: <code>; then</code>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user