docs: styleguide, establish line wrapping and $() instead of ``

This commit is contained in:
David Paleino 2010-02-02 19:02:26 +01:00
parent 61f83856fb
commit 6663709d76

View File

@ -37,22 +37,33 @@ be more efficient in some cases and may reduce need for nesting
conditions, and it's cleaner to write for example [[ ... && ... ]] conditions, and it's cleaner to write for example [[ ... && ... ]]
than [ ... ] && [ ... ], and in general [[ ]] has more features. than [ ... ] && [ ... ], and in general [[ ]] has more features.
Line wrapping
-------------
Try to wrap lines at 72 characters. Never go past this limit, unless
you absolutely need to (example: a long sed regular expression, or the
like). This also holds true for the documentation and the testsuite.
Other files, like ChangeLog, or COPYING, are exempt from this rule.
$(...) vs `...`
---------------
When you need to do some code substitution in your completion script,
you *MUST* use the $(...) construct, rather than the `...`. The former
is preferable because anyone, with any keyboard layout, is able to
type it. Backticks aren't always available, without doing strange
key combinations.
///////////////////////////////////////// /////////////////////////////////////////
case/esac vs if case/esac vs if
--------------- ---------------
line wrapping
-------------
quoting quoting
------- -------
awk vs cut for simple cases awk vs cut for simple cases
--------------------------- ---------------------------
$(...) vs `...`
---------------
variable and function naming variable and function naming
---------------------------- ----------------------------