Skip to content

Instantly share code, notes, and snippets.

@rcmdnk
Created December 15, 2014 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcmdnk/b7c17c42d108cc1860a2 to your computer and use it in GitHub Desktop.
Save rcmdnk/b7c17c42d108cc1860a2 to your computer and use it in GitHub Desktop.
# Execution part {{{
_s_is_exec=1
_sf_check_args_first () { # {{{
while [ $# -gt 0 ];do
case $1 in
"-h"|"-N"|"-m"|"-p"|"-F"|"-v" ) _s_is_exec=2;shift;;
"-n" ) _s_is_exec=0;shift;;
"-c" ) _SENTAKU_CHILD=1;shift;;
* )break;;
esac
done
} # }}}
_sf_check_args_first "$@"
# Execute if stdin is available, or any of help/file/push is on
if [ $_s_is_exec -ne 0 ];then
if [ -p /dev/stdin ] || [ $_s_is_exec -eq 2 ];then
_sf_main "$@"
fi
fi
# Clean up
unset _s_is_exec
# }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment