mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
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:
parent
54b2e10da4
commit
bd085a820d
2 changed files with 14 additions and 12 deletions
|
@ -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'"
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue