Skip to content

Commit

Permalink
+ func: taskw: task: add back just task(), it belongs in personal rc
Browse files Browse the repository at this point in the history
this indirection for 'task' invocations is only doing two things:

    - if --version requested, just give that and exit
    - otherwise, pass along args, but set rc.defaultwidth=$COLUMNS
        - helps with piping output of 'task' to things

originally we had moved the function into taskwtools along with all the
others in "the big move" from bash profile functions to our taskwtools
task.sh invname-switcher, but it's causing problems there, and adding
wrap in a pipeline might be said to be a local decision anyways.  it
seems we can't reliably determine the full path to a script accessed
through a symlink, without calling readlink, anyways.

now, we will move it back into our bash profile, for the moment, it
solves a lot of problems if taskwtools does not have to make this work
in a standalone script
  • Loading branch information
smemsh committed Jul 9, 2024
1 parent 8884894 commit 666ddbe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions func.d/taskw
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
# taskwarrior
#

# work around always defaulting to 80 columns when piping
# note: ${COLUMNS:-80} not needed, blank value is default (which is 80)
# todo: implement env var expansion in taskwarrior
# also: #991
#
task ()
{
for arg; do if [[ $arg == '--' ]]; then break
elif [[ $arg == '--version' ]]
then `type -P task` --version; return; fi; done

`type -P task` rc.defaultwidth=$COLUMNS "$@"
}

# for taskadd
#
taskaddl () { TASKADD="$*"; } # additional args (such as tags)
Expand Down

0 comments on commit 666ddbe

Please sign in to comment.