Code Cleanup

- Improved style and efficiency of Perl test code.
- Added alias expansion to feature log of bash completion script.
- Added comments to bash completion script.
This commit is contained in:
Scott Kostyshak 2012-08-05 14:56:48 -04:00 committed by Paul Beckingham
parent 54b2e10da4
commit bd085a820d
2 changed files with 14 additions and 12 deletions

View file

@ -31,6 +31,7 @@
# *) task subcommands
# *) project names
# *) tag names
# *) aliases
#
# To use these routines:
#
@ -50,6 +51,7 @@
# http://taskwarrior.org
#
################################################################################
#the following variable is substituted for by ../../test/bash_completion.t
taskcommand='task'
_task_get_tags() {
@ -85,6 +87,7 @@ _task()
else
prev2=""
fi
# useful for debugging:
# echo -e "\ncur='$cur'"
# echo "prev='$prev'"
# echo "prev2='$prev2'"

View file

@ -59,18 +59,17 @@ if (open my $target, '>', 'task.sh')
}
}
close ($source);
print $target 'COMP_WORDS=("$@")';
print $target "\n";
print $target 'COMP_CWORD=$(($#-1))';
print $target "\n";
print $target '_task';
print $target "\n";
print $target 'for reply_iter in "${COMPREPLY[@]}"; do';
print $target "\n";
print $target ' echo $reply_iter';
print $target "\n";
print $target 'done';
print $target 'COMP_WORDS=("$@")',
"\n",
'COMP_CWORD=$(($#-1))',
"\n",
'_task',
"\n",
'for reply_iter in "${COMPREPLY[@]}"; do',
"\n",
' echo $reply_iter',
"\n",
'done';
close $target;
ok (-r 'task.sh', 'Created task.sh');
}