This patch fixes the 'list_projects()' which did not work because it was using
the 'cfg_descr' variable which was undefined. Indeed, this function is called
when the user either forgot to specify the project, or specified a non-existing
project.
This patch uses 'ini_config_get_or_die' to get project description. The whole
loop conctruct is cleaned up a bit too to make it more readable.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
{
local prj
- LC_ALL=C sed -n -e "s/^\[prj_\(.*\)\]$/\1/p" "$cfgfile" | while read -r prj; do
- printf "* %s\n" "$cfg_ownmail_local+$prj@$cfg_ownmail_domain: $cfg_descr"
+ LC_ALL=C sed -n -e "s/^\[prj_\(.*\)\]$/\1/p" "$cfgfile" | \
+ while read -r prj; do
+ # Get project description
+ local descr
+ ini_config_get_or_die descr "$cfgfile" "prj_$prj" "description"
+
+ local email="$cfg_ownmail_local+$prj@$cfg_ownmail_domain"
+ printf "* %s\n" "$prj ($email): $descr"
done
}