Skip to content

Commit

Permalink
Merge pull request #10 from reegnz/feature/zsh_alias_support
Browse files Browse the repository at this point in the history
zsh alias support
  • Loading branch information
reegnz authored Nov 19, 2021
2 parents 79c0ebc + 909aba4 commit acadd6d
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 acadd6d

Please sign in to comment.