Drops the function keyword and uses only func(){} syntax as per the POSIX specification: v2

Lars Moelleken 2015-11-06 13:45:12 +01:00
parent fed196a67d
commit 8dcbb407a0

@ -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)