From 8dcbb407a0e784a51fc95802c44211c6f1f12965 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Fri, 6 Nov 2015 13:45:12 +0100 Subject: [PATCH] Drops the `function` keyword and uses only `func(){}` syntax as per the POSIX specification: v2 --- Coding-style-guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Coding-style-guide.md b/Coding-style-guide.md index b69fbc4..b21fdb5 100644 --- a/Coding-style-guide.md +++ b/Coding-style-guide.md @@ -318,7 +318,7 @@ fi ### Naming Conventions -Lower-case, with underscores to separate words. Parentheses are required after the function name. The `function` keyword is optional when `()` is present after the function name, but it aids readability and prevents [conflicts with alias declarations](http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Aliasing), so please use it! +Lower-case, with underscores to separate words. Parentheses are required after the function name. The `function` keyword is optional when `()` is present after the function name, but it aids readability and prevents [conflicts with alias declarations](http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Aliasing). But the POSIX specification says "`fname() compound-command[io-redirect ...]`", so we prefer the default from the specification! The opening brace should appear on the same line as the function name. @@ -446,4 +446,4 @@ Eval is evil! Eval munges the input when used for assignment to variables and ca - [Shell Style Guide](https://google-styleguide.googlecode.com/svn/trunk/shell.xml) - [BASH Programming - Introduction HOW-TO](http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html) -- [Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle) +- [Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle) \ No newline at end of file