mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 05:59:46 +08:00
Compare commits
3 Commits
8cbe98469d
...
54779e5250
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54779e5250 | ||
|
|
73c4764e78 | ||
|
|
723af07a56 |
3126
plugins/docker/_docker
Normal file
3126
plugins/docker/_docker
Normal file
File diff suppressed because it is too large
Load Diff
@ -37,8 +37,10 @@ if (( ! $+commands[docker] )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
{
|
{
|
||||||
|
# docker version returns `Docker version 24.0.2, build cb74dfcd85`
|
||||||
|
# with `s:,:` remove the comma after the version, and select third word of it
|
||||||
|
local _docker_version=${${(s:,:z)"$(command docker --version)"}[3]}
|
||||||
# `docker completion` is only available from 23.0.0 on
|
# `docker completion` is only available from 23.0.0 on
|
||||||
local _docker_version=$(command docker version --format '{{.Client.Version}}' 2>/dev/null)
|
|
||||||
if is-at-least 23.0.0 $_docker_version; then
|
if is-at-least 23.0.0 $_docker_version; then
|
||||||
# If the completion file doesn't exist yet, we need to autoload it and
|
# If the completion file doesn't exist yet, we need to autoload it and
|
||||||
# bind it to `docker`. Otherwise, compinit will have already done that.
|
# bind it to `docker`. Otherwise, compinit will have already done that.
|
||||||
|
|||||||
@ -80,7 +80,13 @@ function jira() {
|
|||||||
issue_arg=${issue_arg##*/}
|
issue_arg=${issue_arg##*/}
|
||||||
# Strip suffixes starting with _
|
# Strip suffixes starting with _
|
||||||
issue_arg=(${(s:_:)issue_arg})
|
issue_arg=(${(s:_:)issue_arg})
|
||||||
|
# If there is only one part, it means that there is a different delimiter. Try with -
|
||||||
|
if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then
|
||||||
|
issue_arg=(${(s:-:)issue_arg})
|
||||||
|
issue_arg="${issue_arg[1]}-${issue_arg[2]}"
|
||||||
|
else
|
||||||
issue_arg=${issue_arg[1]}
|
issue_arg=${issue_arg[1]}
|
||||||
|
fi
|
||||||
if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then
|
if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then
|
||||||
issue="${issue_arg}"
|
issue="${issue_arg}"
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user