tips:taskfile

This is an old revision of the document!


taskfile

curl -s "http://wiki.csgalileo.org/tips:taskfile?do=export_code&codeblock=2" > task
taskfile
#!/usr/bin/env bash

dir=$(pwd)

function task:example {
  echo bla bla
}

function task:default {
    task:help
}

function task:help {
    echo "$0 <task> <args>"
    echo "Tasks:"

    # We pick out the `task:*` functions
    compgen -A function | sed -En 's/task:(.*)/\1/p' | cat -n
}

TIMEFORMAT="Task completed in %3lR"
time "task:${@:-help}"
  • tips/taskfile.1649654890.txt.gz
  • Last modified: 2022/04/11 07:28
  • by sscipioni