Update gmtxy-dot.sh

add -q option
This commit is contained in:
张壹 2019-09-02 14:22:25 +08:00
parent 6dd66f0e43
commit d4b15a47d1

View File

@ -10,9 +10,10 @@ overwriteRange='null'
overwrite=0 overwrite=0
labels=("x (m)" "y (m)") labels=("x (m)" "y (m)")
valuerange="0/1000/10" valuerange="0/1000/10"
noshow=0
# 从命令行获取参数 # 从命令行获取参数
while getopts "hi:r:u:c:a:d:" arg while getopts "hqi:r:u:c:a:d:" arg
do do
case $arg in case $arg in
h) h)
@ -25,6 +26,7 @@ For futher explanations, please look for GMT's manuscripts.\nAuthor: Yi Zhang (z
printf "%s\t%s\n" "-u" "data unit. The default is meter." printf "%s\t%s\n" "-u" "data unit. The default is meter."
printf "%s\t%s\n" "-c" "color cpt. The default is rainbow." printf "%s\t%s\n" "-c" "color cpt. The default is rainbow."
printf "%s\t%s\n" "-a" "axis labels. The deafults are x (m) and y (m)." printf "%s\t%s\n" "-a" "axis labels. The deafults are x (m) and y (m)."
printf "%s\t%s\n" "-q" "do not show the output figure."
exit 0;; exit 0;;
i) i)
data=$OPTARG;; data=$OPTARG;;
@ -39,6 +41,8 @@ For futher explanations, please look for GMT's manuscripts.\nAuthor: Yi Zhang (z
labels=(${OPTARG//,/ });; labels=(${OPTARG//,/ });;
d) d)
valuerange=$OPTARG;; valuerange=$OPTARG;;
q)
noshow=1;;
?) ?)
printf "error: unknow argument\nuse -h option to see help information\n" printf "error: unknow argument\nuse -h option to see help information\n"
exit 1;; exit 1;;
@ -80,5 +84,7 @@ else
# 在终端显示图像 此命令需要imgcat.sh脚本和iTerm终端 # 在终端显示图像 此命令需要imgcat.sh脚本和iTerm终端
#imgcat $jpgfile #imgcat $jpgfile
# 打开图片文件 此命令使用MacOS终端open命令 # 打开图片文件 此命令使用MacOS终端open命令
open $jpgfile if [[ ${noshow} == 0 ]]; then
open $jpgfile
fi
fi fi