Skip to content

Commit

Permalink
*: more arithmetic expression consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Apr 22, 2019
1 parent 2a04042 commit c8c1b4d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ _get_comp_words_by_ref()
*) echo "bash_completion: $FUNCNAME: \`${!OPTIND}':" \
"unknown argument" >&2; return 1 ;;
esac
let "OPTIND += 1"
(( OPTIND += 1 ))
done

__get_cword_at_cursor_by_ref "$exclude" words cword cur
Expand Down Expand Up @@ -1515,7 +1515,7 @@ _known_hosts_real()
done
[[ $# -lt $OPTIND ]] && \
echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2
cur=${!OPTIND}; let "OPTIND += 1"
cur=${!OPTIND}; (( OPTIND += 1 ))
[[ $# -ge $OPTIND ]] && \
echo "bash_completion: $FUNCNAME("$@"): unprocessed arguments:" \
$(while [[ $# -ge $OPTIND ]]; do printf '%s\n' ${!OPTIND}; shift; done) >&2
Expand Down
32 changes: 16 additions & 16 deletions completions/tipc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ _tipc()

case "${words[$optind]}" in
bearer)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'enable disable set get list' -- $cur) )
Expand All @@ -105,7 +105,7 @@ _tipc()
case "${words[$optind]}" in
enable)
local media params
let optind++
(( optind++ ))

if [[ $cword -lt $optind+4 ]]; then
_tipc_bearer $optind
Expand Down Expand Up @@ -151,12 +151,12 @@ _tipc()
COMPREPLY=( $(compgen -W '${params[@]}' -- $cur) )
;;
disable)
let optind++
(( optind++ ))

_tipc_bearer $optind
;;
get)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
_tipc_link_opts
Expand All @@ -165,7 +165,7 @@ _tipc()
fi
;;
set)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
_tipc_link_opts
Expand All @@ -176,7 +176,7 @@ _tipc()
esac
;;
link)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'get set list statistics' -- $cur) )
Expand All @@ -185,7 +185,7 @@ _tipc()

case "${words[$optind]}" in
get)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
_tipc_link_opts
Expand All @@ -194,7 +194,7 @@ _tipc()
fi
;;
set)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
_tipc_link_opts
Expand All @@ -203,7 +203,7 @@ _tipc()
fi
;;
statistics)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'show reset' -- $cur) )
Expand All @@ -219,7 +219,7 @@ _tipc()
esac
;;
media)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'get set list' -- $cur) )
Expand All @@ -228,7 +228,7 @@ _tipc()

case "${words[$optind]}" in
get)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
_tipc_link_opts
Expand All @@ -237,7 +237,7 @@ _tipc()
fi
;;
set)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
_tipc_link_opts
Expand All @@ -248,14 +248,14 @@ _tipc()
esac
;;
nametable)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'show' -- $cur) )
fi
;;
node)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'list get set' -- $cur) )
Expand All @@ -264,15 +264,15 @@ _tipc()

case "${words[$optind]}" in
get|set)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'address netid' -- $cur) )
fi
esac
;;
socket)
let optind++
(( optind++ ))

if [[ $cword -eq $optind ]]; then
COMPREPLY=( $(compgen -W 'list' -- $cur) )
Expand Down

0 comments on commit c8c1b4d

Please sign in to comment.