码迷,mamicode.com
首页 > 其他好文 > 详细

Bash script set help function

时间:2018-08-13 22:55:53      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:OLE   detail   cti   $1   ash   break   com   shift   case   

set -o nounset

help()
{
    cat <<- EOF
    Desc: execute f1x for each case in Codeflaws
    Usage: ./exec_codeflaws.sh [Codeflaw_dir] [f1x_path] [run-f1x-codeflaw.rb_Dir]
    EOF
    exit 0
}

while [ -n "$1" ]; do
    case $1 in
        -h) help;;
        --) shift;break;;
        -*) echo "error: no such option $1."; exit 1;;
        *) break;;
esac
done

Referred from: https://blog.csdn.net/hejinjing_tom_com/article/details/79946427

Bash script set help function

标签:OLE   detail   cti   $1   ash   break   com   shift   case   

原文地址:https://www.cnblogs.com/XBWer/p/9471506.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!