首页 > 其他 > 详细

Bash script set help function

时间:2018-08-13 22:49:49      阅读:161      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!