提交 ae575430 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!3 add help param and info

Merge pull request !3 from zhuchunyi/master
......@@ -21,7 +21,7 @@ Generally, the disk space is more than 50g.
#### Contribution
oemaker <font color=#0000FF >_[-t Type] [-p Product] [-v Version] [-r RELEASE] [-s REPOSITORY]_</font>
oemaker <font color=#0000FF >_[-h] [-t Type] [-p Product] [-v Version] [-r RELEASE] [-s REPOSITORY]_</font>
optional arguments:
-t Type
......@@ -38,3 +38,6 @@ oemaker <font color=#0000FF >_[-t Type] [-p Product] [-v Version] [-r RELEASE] [
-s REPOSITORY
source dnf repository address link(may be listed multiple times)
-h
show the help message and exit
......@@ -16,6 +16,21 @@
#!/bin/bash
set -e
function oemaker_usage()
{
cat << EOF
Usage: oemaker [-h] [-t Type] [-p Product] [-v Version] [-r RELEASE] [-s REPOSITORY]
optional arguments:
-t Type ISO Type, include standard debug and source
-p Product Product Name, such as: openEuler
-v Version version identifier
-r RELEASE release information
-s REPOSITORY source dnf repository address link(may be listed multiple times)
-h show the help message and exit
EOF
}
function parse_cmd_line()
{
#param init
......@@ -34,16 +49,33 @@ function parse_cmd_line()
ISOTYPE="standard"
# parse input params
while getopts ":p:v:r:s:t:" opt
while getopts ":p:v:r:s:t:h" opt
do
case "$opt" in
p) PRODUCT="$OPTARG";;
v) VERSION="$OPTARG";;
r) RELEASE="$OPTARG";;
s) REPOS1="$OPTARG";;
t) ISOTYPE="$OPTARG";;
?) printf "Usage: %s: [-f config_file] args\n" "$0"
return 1;;
p)
PRODUCT="$OPTARG"
;;
v)
VERSION="$OPTARG"
;;
r)
RELEASE="$OPTARG"
;;
s)
REPOS1="$OPTARG"
;;
t)
ISOTYPE="$OPTARG"
;;
h)
oemaker_usage
exit 0
;;
?)
echo "error: please check the params."
oemaker_usage
return 1
;;
esac
done
......@@ -101,14 +133,7 @@ function global_var_init()
set -e
return 0
}
#######################################
# copy config.
# Arguments:
# None
# Returns:
# Success: 0
# Failed: 1
#######################################
function init_config()
{
[ -f "${BUILD}"/isopackage.sdf ] && cp "${BUILD}"/isopackage.sdf "${BUILD}"/iso/
......
......@@ -37,10 +37,9 @@ function mkclean()
function mk_euleros_main()
{
echo "Parsing cmd line..."
parse_cmd_line "$@"
if [ $? -ne 0 ]; then
echo "parse params error"
echo "parse params failed"
return 1
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册