Fix duplicate call of _hledger_compreply_optarg()
It was called in both conditional branches so it's moved out before the conditional.
This commit is contained in:
parent
9dc65e4ee5
commit
4101fdf3bb
@ -49,9 +49,10 @@ _hledger_completion_function() {
|
|||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -z $subcommand ]]; then
|
# Option argument completion
|
||||||
_hledger_compreply_optarg && return
|
_hledger_compreply_optarg && return
|
||||||
|
|
||||||
|
if [[ -z $subcommand ]]; then
|
||||||
# Completion lists are already sorted at build-time
|
# Completion lists are already sorted at build-time
|
||||||
# This keeps commands and options grouped separately
|
# This keeps commands and options grouped separately
|
||||||
compopt -o nosort +o filenames
|
compopt -o nosort +o filenames
|
||||||
@ -61,9 +62,6 @@ _hledger_completion_function() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Option argument completion after subcommand too
|
|
||||||
_hledger_compreply_optarg && return
|
|
||||||
|
|
||||||
# Avoid setting compopt bellow if completing an option
|
# Avoid setting compopt bellow if completing an option
|
||||||
[[ $cur == -* ]] && return
|
[[ $cur == -* ]] && return
|
||||||
|
|
||||||
|
|||||||
@ -49,9 +49,10 @@ _hledger_completion_function() {
|
|||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -z $subcommand ]]; then
|
# Option argument completion
|
||||||
_hledger_compreply_optarg && return
|
_hledger_compreply_optarg && return
|
||||||
|
|
||||||
|
if [[ -z $subcommand ]]; then
|
||||||
# Completion lists are already sorted at build-time
|
# Completion lists are already sorted at build-time
|
||||||
# This keeps commands and options grouped separately
|
# This keeps commands and options grouped separately
|
||||||
compopt -o nosort +o filenames
|
compopt -o nosort +o filenames
|
||||||
@ -61,9 +62,6 @@ _hledger_completion_function() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Option argument completion after subcommand too
|
|
||||||
_hledger_compreply_optarg && return
|
|
||||||
|
|
||||||
# Avoid setting compopt bellow if completing an option
|
# Avoid setting compopt bellow if completing an option
|
||||||
[[ $cur == -* ]] && return
|
[[ $cur == -* ]] && return
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user