mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
feat(jira-auto-worklog): Add jira-auto-worklog plugin
This commit is contained in:
parent
7a3695aadf
commit
75483693fb
4 changed files with 236 additions and 0 deletions
20
plugins/jira-auto-worklog/jira-auto-worklog.plugin.zsh
Normal file
20
plugins/jira-auto-worklog/jira-auto-worklog.plugin.zsh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# zle-line-init widget (don't redefine if already defined)
|
||||
(( ! ${+functions[_jira-auto-worklog_zle-line-init]} )) || return 0
|
||||
|
||||
# Get the directory of this file
|
||||
dir="$(dirname "$0")"
|
||||
|
||||
case "$widgets[zle-line-init]" in
|
||||
# Simply define the function if zle-line-init doesn't yet exist
|
||||
builtin|"") function _jira-auto-worklog_zle-line-init() {
|
||||
($dir/jira-auto-worklog &> /dev/null)
|
||||
} ;;
|
||||
# Override the current zle-line-init widget, calling the old one
|
||||
user:*) zle -N _jira-auto-worklog_orig_zle-line-init "${widgets[zle-line-init]#user:}"
|
||||
function _jira-auto-worklog_zle-line-init() {
|
||||
($dir/jira-auto-worklog &> /dev/null)
|
||||
zle _jira-auto-worklog_orig_zle-line-init -- "$@"
|
||||
} ;;
|
||||
esac
|
||||
|
||||
zle -N zle-line-init _jira-auto-worklog_zle-line-init
|
||||
Loading…
Add table
Add a link
Reference in a new issue