Browse Source

First commit

master
dig 4 years ago
parent
commit
982ffa039b
  1. 80
      tasks/.taskrc

80
tasks/.taskrc

@ -0,0 +1,80 @@
#!/home/dig/bin/shtpl
#!/bin/bash
$(read -r -p Need\ some\ infos\ for\ task\ $TASK_NAME\ \(\ \hit\ enter\ \)\ v)
##
## Task $TASK_NAME v$(read -r -p Version?\ v;echo $v)
## Copyright (C) $(read -r -p Author?\ v;echo $v)
## Licensed under $(read -r -p Licensed\ under?\ v;echo $v)
##
## $(read -r -p What\'s\ used\ for? v;echo $v)
##
## Usage:
## @script.name $(read -r -p Usage:\ $TASK_NAME\ v;echo $v)
##
## Options:
## ( Long version are mandatory, and can be before or after short version )
##
## -h, --help Show this help.
## -v, --verbose Show sub-task resolution and options parsed.
##
##
## Exemples:
##
##
# wirte tour default options here
source easyoptions || exit
verbose() { [[ -n "$verbose" ]] && echo $1; }
##### YOUR CODE HERE #####
##### SNIPPETS ##################################################################
# Boolean and parameter options
# [[ -n "\$option" ]] && echo "Option specified: --option is \$option"
# Arguments
#for argument in "\${arguments[@]}"; do
# echo "Argument specified: \$argument"
#done
# Verbose (echo only if -v or --verbose options
#verbose "I\'m doing things"
#mkdir "cant/create/this" || verbose "Error creating folder!"
# Auto called function acording to 1st agument
#command()
#{
# # here get 2nd argument with $1 (local 1st arg) or ${arguments[2]} (script)
#}
################################################################################
# Calls command (1rt argument) as script or function \$1( \$2 \$3 ... )
if [ -r "\$(dirname \$0)/.\$(basename \$0)/\$1" ]
then
verbose "Command file exists call it: \$(dirname \$0)/.\$(basename \$0)/\$1 \${*:2}"
\$(dirname \$0)/.\$(basename \$0)/\$1 \${*:2}
else
if [ -n "$(type -t $1)" ] && [ "$(type -t $1)" = function ];
then
verbose "\$(dirname \$0)/.\$(basename \$0)/\$1 not exists try func: \$1 \${*:2}"
\$1 "\${*:2}"
fi
fi
Loading…
Cancel
Save