浏览代码

setup.sh: Add help subcommand

pull/1/head
10sr 9 年前
父节点
当前提交
3185956a74
共有 1 个文件被更改,包括 15 次插入4 次删除
  1. +15
    -4
      setup.sh

+ 15
- 4
setup.sh 查看文件

@@ -470,21 +470,32 @@ setup_env(){


#########################
# main
# help and main

help(){
echo "Usage: ./setup.sh <cmd> ..."
echo " or: ./setup.sh help"
echo "Available cmds are: $__setups"
}

main(){
detect_systems

if test -z "$1"
then
echo "Usage: ./setup.sh <cmd> ..."
echo "Available cmds are: $__setups"
exit 1
help
return 1
fi

_cmd=$1
shift

if test "$_cmd" = help
then
help
return 0
fi

_msg Running setup_$_cmd
setup_$_cmd "$@"
_msg Running setup_$_cmd done


正在加载...
取消
保存