tips:taskfile

This is an old revision of the document!


taskfile

curl -L "http://wiki.csgalileo.org/tips:taskfile?do=export_code&codeblock=1" | /bin/bash
curl -L "http://wiki.csgalileo.org/tips:taskfile?do=export_code&codeblock=2" > task
chmod +x 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.1649655283.txt.gz
  • Last modified: 2022/04/11 07:34
  • by sscipioni