mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-22 12:35:13 +00:00
--option-parsing: useful for completion
This commit is contained in:
parent
4a3d59c3a4
commit
72b44a84f6
20
src/tomb
20
src/tomb
@ -1648,7 +1648,20 @@ main() {
|
||||
done
|
||||
local -a oldstar
|
||||
oldstar=($argv)
|
||||
zparseopts -M -E -D -Adiscardme ${every_opts}
|
||||
#### detect early: useful for --optiion-parsing
|
||||
zparseopts -M -D -Adiscardme ${every_opts}
|
||||
if [[ -n ${(k)discardme[--option-parsing]} ]]; then
|
||||
echo $1
|
||||
if [[ -n "$1" ]]; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
unset discardme
|
||||
if ! zparseopts -M -E -D -Adiscardme ${every_opts}; then
|
||||
error "error parsing"
|
||||
return 127
|
||||
fi
|
||||
unset discardme
|
||||
subcommand=$1
|
||||
if [[ -z $subcommand ]]; then
|
||||
@ -1783,8 +1796,9 @@ EOF
|
||||
# {{{ RUNTIME
|
||||
check_bin
|
||||
main $@
|
||||
if [[ $? != 0 ]]; then #this "if" seems useless, but avoid source tomb source from exiting
|
||||
exit $?
|
||||
ret=$?
|
||||
if [[ $ret != 0 ]]; then #this "if" seems useless, but avoid source tomb source from exiting
|
||||
exit $ret
|
||||
fi
|
||||
# }}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user