Skip to content

Commit 79fc3ca

Browse files
committed
CodingGuidelines: give an example for case/esac statement
Signed-off-by: Junio C Hamano <[email protected]>
1 parent dd30800 commit 79fc3ca

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Documentation/CodingGuidelines

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ For shell scripts specifically (not exhaustive):
4242

4343
- We use tabs for indentation.
4444

45-
- Case arms are indented at the same depth as case and esac lines.
45+
- Case arms are indented at the same depth as case and esac lines,
46+
like this:
47+
48+
case "$variable" in
49+
pattern1)
50+
do this
51+
;;
52+
pattern2)
53+
do that
54+
;;
55+
esac
4656

4757
- Redirection operators should be written with space before, but no
4858
space after them. In other words, write 'echo test >"$file"'

0 commit comments

Comments
 (0)