It is only used in _gsu_print_available_commands() so we may
make it local to this function.
_gsu_print_available_commands()
{
- local cmd
+ local cmd cmds
local -i count=0
+ _gsu_available_commands
+ cmds="$result"
printf 'Available commands:\n'
- for cmd in $gsu_cmds; do
+ for cmd in $cmds; do
printf '%s' "$cmd"
let ++count
if (($count % 4)); then
gsu()
{
local i
- _gsu_available_commands
- gsu_cmds="$result"
+
if (($# == 0)); then
_gsu_usage
_gsu_print_available_commands