Skip to content

Commit

Permalink
zsh alias support
Browse files Browse the repository at this point in the history
  • Loading branch information
reegnz committed Nov 12, 2021
1 parent 79c0ebc commit 909aba4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jq.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
if [[ -o zle ]]; then

__get_query() {
jq-repl -- ${LBUFFER}
return $?
if [ "${JQ_ZSH_PLUGIN_EXPAND_ALIASES:-0}" -eq 1 ]; then
unset 'functions[_jq-plugin-expand]'
functions[_jq-plugin-expand]=${LBUFFER}
(($+functions[_jq-plugin-expand])) && COMMAND=${functions[_jq-plugin-expand]#$'\t'}
jq-repl -- ${COMMAND}
return $?
else
jq-repl -- ${LBUFFER}
return $?
fi
}

jq-complete() {
Expand Down

0 comments on commit 909aba4

Please sign in to comment.