diff options
author | David Paleino <dapal@debian.org> | 2010-02-02 19:02:26 +0100 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2010-02-02 19:02:26 +0100 |
commit | 6663709d7679cfbc770665dc01175ac65b6f5c6f (patch) | |
tree | dbe4bcbd7353c86e425b3af8071a46e6daf2c853 | |
parent | 61f83856fb1365e8c9df525dbcc5b74708ddbfe4 (diff) | |
download | bash-completion-6663709d7679cfbc770665dc01175ac65b6f5c6f.tar.gz |
docs: styleguide, establish line wrapping and $() instead of ``
-rw-r--r-- | doc/styleguide.txt | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/doc/styleguide.txt b/doc/styleguide.txt index 39aedf82..85e1fbb4 100644 --- a/doc/styleguide.txt +++ b/doc/styleguide.txt @@ -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 [[ ... && ... ]] 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 --------------- -line wrapping -------------- - quoting ------- awk vs cut for simple cases --------------------------- -$(...) vs `...` ---------------- - variable and function naming ---------------------------- |