CodingGuidelines: give an example for case/esac statement
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Apr 30, 2014 at 14:24 UTC
79fc3ca1232099fd21e5bdef14c1b6fe1d2dbc1c
1 file changed
+11
-1
Documentation/CodingGuidelines
+11
-1
@@ -42,7 +42,17 @@ For shell scripts specifically (not exhaustive):
42
43
- We use tabs for indentation.
44
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
56
57
- Redirection operators should be written with space before, but no
58
space after them. In other words, write 'echo test >"$file"'