mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
Cosmetic changes
This commit is contained in:
parent
872484729e
commit
e3826be379
@ -15,11 +15,10 @@ set -o pipefail
|
||||
# for example grepping an array or map a substitution on it.
|
||||
# Therefore, we create temp files in RAM for completion suggestions (see below).
|
||||
|
||||
declare -g HLEDGER_COMPLETION_TEMPDIR
|
||||
HLEDGER_COMPLETION_TEMPDIR=$(mktemp -d)
|
||||
readonly HLEDGER_COMPLETION_TEMPDIR=$(mktemp -d)
|
||||
|
||||
hledgerCompletionFunction() {
|
||||
declare cmd=$1
|
||||
#declare cmd=$1
|
||||
declare wordToComplete=$2
|
||||
declare precedingWord=$3
|
||||
|
||||
@ -52,7 +51,6 @@ hledgerCompletionFunction() {
|
||||
esac
|
||||
|
||||
if [[ -n $completeFiles ]]; then
|
||||
:
|
||||
#COMP_WORDBREAKS='= '
|
||||
COMPREPLY+=( $(compgen -df | grep "^$filenameSoFar") )
|
||||
|
||||
@ -62,7 +60,8 @@ hledgerCompletionFunction() {
|
||||
|
||||
else
|
||||
|
||||
# Almost all subcommands accpt [QUERY] -> always add accounts to completion list
|
||||
# Almost all subcommands accept [QUERY]
|
||||
# -> always add accounts to completion list
|
||||
|
||||
COMP_WORDBREAKS=' '
|
||||
COMPREPLY+=( $(hledger accounts --flat | grep "^$wordToComplete") )
|
||||
@ -71,10 +70,11 @@ hledgerCompletionFunction() {
|
||||
|
||||
}
|
||||
|
||||
# Register completion function for hledger:
|
||||
complete -F hledgerCompletionFunction hledger
|
||||
|
||||
# Include lists of commands and options generated by the Makefile using m4
|
||||
# macro processor.
|
||||
# Include lists of commands and options generated by the Makefile using the
|
||||
# m4 macro processor.
|
||||
# Included files must have exactly one newline at EOF to prevent weired errors.
|
||||
|
||||
cat <<TEXT > "$HLEDGER_COMPLETION_TEMPDIR/commands.txt"
|
||||
|
Loading…
Reference in New Issue
Block a user