From 50dd14ce0dd36c6f467c831b3000e3302d6249f8 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 21 Jun 2011 03:41:33 +0000 Subject: [PATCH] added bullets to top comment information to make it more readable --- inxi | 79 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/inxi b/inxi index 21e3865..5f4b65b 100755 --- a/inxi +++ b/inxi @@ -78,38 +78,37 @@ #### -S For desktop environment, user must be in X and have xprop installed (in X11-utils) ######################################################################## #### CONVENTIONS: -#### Indentation: TABS -#### Do not use `....` (back quotes), those are totally non-reabable, use $(....). -#### Do not use one liner flow controls. -#### The ONLY time you should use ';' (semi-colon) is in this single case: if [[ condition ]];then. -#### Never use compound 'if': ie, if [[ condition ]] && statement. -#### Note: [[ -n $something ]] - double brackets does not require quotes for variables: ie, "$something". -#### Always use quotes, double or single, for all string values. -#### -#### All new code/methods must be in a function. -#### For all boolean tests, use 'true' / 'false'. -#### !! Do NOT use 0 or 1 unless it's a function return. -#### Avoid complicated tests in the if condition itself. -#### To 'return' a value in a function, use 'echo '. -#### -#### For gawk: use always if ( num_of_cores > 1 ) { hanging { starter for all blocks -#### This lets us use one method for all gawk structures, including BEGIN/END, if, for, etc +#### * Character Encoding: UTF-8 - this file contains special characters that must be opened and saved as UTF8 +#### * Indentation: TABS +#### * Do not use `....` (back quotes), those are totally non-reabable, use $(....). +#### * Do not use one liner flow controls. +#### The ONLY time you should use ';' (semi-colon) is in this single case: if [[ condition ]];then. +#### Never use compound 'if': ie, if [[ condition ]] && statement. +#### * Note: [[ -n $something ]] - double brackets does not require quotes for variables: ie, "$something". +#### * Always use quotes, double or single, for all string values. +#### * All new code/methods must be in a function. +#### * For all boolean tests, use 'true' / 'false'. +#### !! Do NOT use 0 or 1 unless it's a function return. +#### * Avoid complicated tests in the if condition itself. +#### * To 'return' a value in a function, use 'echo '. +#### * For gawk: use always if ( num_of_cores > 1 ) { hanging { starter for all blocks +#### This lets us use one method for all gawk structures, including BEGIN/END, if, for, etc #### #### VARIABLE/FUNCTION NAMING: -#### All functions should follow standard naming--verb adjective noun. -#### ie, get_cpu_data -#### All variables MUST be initialized / declared explicitly. -#### All variables should clearly explain what they are, except counters like i, j. -#### Each word of variable must be separated by '_' (underscore) (camel form). -#### Global variables are 'UPPER CASE', at top of script. -#### ie, SOME_VARIABLE='' -#### Local variables are 'lower case' and declared at the top of the function. -#### ie, some_variable='' -#### Locals that will be inherited by child functions have first char capitalized (so you know they are inherited). -#### ie, Some_Variable -#### -#### Booleans should start with b_ (local) or B_ (global) and state clearly what is being tested. -#### Arrays should start with a_ (local) or A_ (global). +#### * All functions should follow standard naming--verb adjective noun. +#### ie, get_cpu_data +#### * All variables MUST be initialized / declared explicitly, either top of file, for Globals, or using local +#### * All variables should clearly explain what they are, except counters like i, j. +#### * Each word of Bash variable must be separated by '_' (underscore) (camel form), like: cpu_data +#### * Each word of Gawk variable must be like this (first word lower, following start with upper): cpuData +#### * Global variables are 'UPPER CASE', at top of script. +#### ie, SOME_VARIABLE='' +#### * Local variables are 'lower case' and declared at the top of the function using local, always. +#### ie: local some_variable='' +#### * Locals that will be inherited by child functions have first char capitalized (so you know they are inherited). +#### ie, Some_Variable +#### * Booleans should start with b_ (local) or B_ (global) and state clearly what is being tested. +#### * Arrays should start with a_ (local) or A_ (global). #### #### SPECIAL NOTES: #### * The color variable ${C2} must always be followed by a space unless you know what @@ -129,20 +128,16 @@ ################################################################################### #### KDE Konversation information. Moving from dcop(qt3/KDE3) to dbus(qt4/KDE4) ################################################################################### -#### dcop and dbus -- these talk back to Konversation from this script -#### -#### Scripting info -- http://konversation.berlios.de/docs/scripting.html -#### -- http://www.kde.org.uk/apps/konversation/ -#### -#### dbus info -- http://dbus.freedesktop.org/doc/dbus-tutorial.html -#### view dbus info -- https://fedorahosted.org/d-feet/ -#### -- or run qdbus -#### Konvi dbus/usage-- qdbus org.kde.konversation /irc say -#### -#### Python usage -- http://wiki.python.org/moin/DbusExamples (just in case) +#### * dcop and dbus -- these talk back to Konversation from this script +#### * Scripting info -- http://konversation.berlios.de/docs/scripting.html +#### -- http://www.kde.org.uk/apps/konversation/ +#### * dbus info -- http://dbus.freedesktop.org/doc/dbus-tutorial.html +#### view dbus info -- https://fedorahosted.org/d-feet/ +#### -- or run qdbus +#### * Konvi dbus/usage-- qdbus org.kde.konversation /irc say +#### * Python usage -- http://wiki.python.org/moin/DbusExamples (just in case) #### #### Because webpages come and go, the above information needs to be moved to inxi's wiki -#### ######################################################################## #### Valuable Resources #### gawk arrays: http://www.math.utah.edu/docs/info/gawk_12.html