mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-12 07:46:28 +00:00
[cleanup] Uppercase global OPTS
This commit is contained in:
parent
64c20d95f2
commit
b340721307
15
tomb
15
tomb
@ -65,8 +65,7 @@ TMPPREFIX="/dev/shm/$RANDOM.$RANDOM."
|
|||||||
# makes glob matching case insensitive
|
# makes glob matching case insensitive
|
||||||
unsetopt CASE_MATCH
|
unsetopt CASE_MATCH
|
||||||
|
|
||||||
typeset -AH global_opts
|
typeset -AH OPTS # command line options (see main())
|
||||||
typeset -AH opts
|
|
||||||
typeset -H username
|
typeset -H username
|
||||||
|
|
||||||
typeset -H _uid
|
typeset -H _uid
|
||||||
@ -453,7 +452,7 @@ option_is_set() {
|
|||||||
# Second (optional) argument: if "out", command will print it out 'set'/'unset'
|
# Second (optional) argument: if "out", command will print it out 'set'/'unset'
|
||||||
# (useful for if conditions).
|
# (useful for if conditions).
|
||||||
# Return 0 if is set, 1 otherwise
|
# Return 0 if is set, 1 otherwise
|
||||||
[[ -n ${(k)opts[$1]} ]];
|
[[ -n ${(k)OPTS[$1]} ]];
|
||||||
r=$?
|
r=$?
|
||||||
if [[ $2 == out ]]; then
|
if [[ $2 == out ]]; then
|
||||||
if [[ $r == 0 ]]; then
|
if [[ $r == 0 ]]; then
|
||||||
@ -468,7 +467,7 @@ option_is_set() {
|
|||||||
# Get an option value
|
# Get an option value
|
||||||
option_value() {
|
option_value() {
|
||||||
# First argument, the commandline flag (i.e. "-s").
|
# First argument, the commandline flag (i.e. "-s").
|
||||||
print -n - "${opts[$1]}"
|
print -n - "${OPTS[$1]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Messaging function with pretty coloring
|
# Messaging function with pretty coloring
|
||||||
@ -1669,8 +1668,8 @@ mount_tomb() {
|
|||||||
|
|
||||||
# ## Hooks execution
|
# ## Hooks execution
|
||||||
exec_safe_bind_hooks() {
|
exec_safe_bind_hooks() {
|
||||||
if [[ -n ${(k)opts[-o]} ]]; then
|
if [[ -n ${(k)OPTS[-o]} ]]; then
|
||||||
MOUNTOPTS=${opts[-o]}
|
MOUNTOPTS=${OPTS[-o]}
|
||||||
fi
|
fi
|
||||||
local MOUNTPOINT="${1}"
|
local MOUNTPOINT="${1}"
|
||||||
local ME=${SUDO_USER:-$(whoami)}
|
local ME=${SUDO_USER:-$(whoami)}
|
||||||
@ -2066,7 +2065,7 @@ search_tombs() {
|
|||||||
|
|
||||||
# resize tomb file size
|
# resize tomb file size
|
||||||
resize_tomb() {
|
resize_tomb() {
|
||||||
_message "Commanded to resize tomb ::1 tomb name:: to ::2 size:: megabytes." $1 $opts[-s]
|
_message "Commanded to resize tomb ::1 tomb name:: to ::2 size:: megabytes." $1 $OPTS[-s]
|
||||||
if ! [ $1 ]; then
|
if ! [ $1 ]; then
|
||||||
_failure "No tomb name specified for resizing."
|
_failure "No tomb name specified for resizing."
|
||||||
elif ! [ -r "$1" ]; then
|
elif ! [ -r "$1" ]; then
|
||||||
@ -2390,7 +2389,7 @@ main() {
|
|||||||
set -A cmd_opts ${main_opts} ${=subcommands_opts[$subcommand]}
|
set -A cmd_opts ${main_opts} ${=subcommands_opts[$subcommand]}
|
||||||
# if there is no option, we don't need parsing
|
# if there is no option, we don't need parsing
|
||||||
if [[ -n $cmd_opts ]]; then
|
if [[ -n $cmd_opts ]]; then
|
||||||
zparseopts -M -E -D -Aopts ${cmd_opts}
|
zparseopts -M -E -D -AOPTS ${cmd_opts}
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
_warning "Some error occurred during option processing."
|
_warning "Some error occurred during option processing."
|
||||||
exitv=127 _failure "See \"tomb help\" for more info."
|
exitv=127 _failure "See \"tomb help\" for more info."
|
||||||
|
Loading…
Reference in New Issue
Block a user