CodingGuidelines: give an example for case/esac statement
[gitweb.git] / Documentation / CodingGuidelines
index c405b0b9dff81fa00c5aa03ba6cb2222dceac9f8..169b4358c93a8406a7fff10de3529e95cf6b7018 100644 (file)
@@ -42,7 +42,17 @@ For shell scripts specifically (not exhaustive):
 
  - We use tabs for indentation.
 
- - Case arms are indented at the same depth as case and esac lines.
+ - Case arms are indented at the same depth as case and esac lines,
+   like this:
+
+       case "$variable" in
+       pattern1)
+               do this
+               ;;
+       pattern2)
+               do that
+               ;;
+       esac
 
  - Redirection operators should be written with space before, but no
    space after them.  In other words, write 'echo test >"$file"'