1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-26 01:57:26 +08:00

Compare commits

..

No commits in common. "4009668500342d20224c77c7586b4546223c1a77" and "72707d92b1f127a2c16f0447e4d8233ed7b3c10e" have entirely different histories.

4 changed files with 15 additions and 27 deletions

View File

@ -23,9 +23,6 @@ jira reported [username] # queries for issues reported by a user
jira assigned [username] # queries for issues assigned to a user jira assigned [username] # queries for issues assigned to a user
jira myissues # queries for you own issues jira myissues # queries for you own issues
jira branch # opens an existing issue matching the current branch name jira branch # opens an existing issue matching the current branch name
# The branch name may have prefixes ending in "/": "feature/MP-1234",
# and also suffixes starting with "_": "MP-1234_fix_dashboard"
# In both these cases, the issue opened will be "MP-1234"
jira ABC-123 # opens an existing issue jira ABC-123 # opens an existing issue
jira ABC-123 m # opens an existing issue for adding a comment jira ABC-123 m # opens an existing issue for adding a comment
``` ```

View File

@ -63,34 +63,26 @@ function jira() {
else else
# Anything that doesn't match a special action is considered an issue name # Anything that doesn't match a special action is considered an issue name
# but `branch` is a special case that will parse the current git branch # but `branch` is a special case that will parse the current git branch
local issue_arg issue
if [[ "$action" == "branch" ]]; then if [[ "$action" == "branch" ]]; then
# Get name of the branch local issue_arg=$(git rev-parse --abbrev-ref HEAD)
issue_arg=$(git rev-parse --abbrev-ref HEAD) local issue="${jira_prefix}${issue_arg}"
# Strip prefixes like feature/ or bugfix/
issue_arg=${issue_arg##*/}
# Strip suffixes starting with _
issue_arg=(${(s:_:)issue_arg})
issue_arg=${issue_arg[1]}
if [[ "$issue_arg" = ${jira_prefix}* ]]; then
issue="${issue_arg}"
else else
issue="${jira_prefix}${issue_arg}" local issue_arg=$action
local issue="${jira_prefix}${issue_arg}"
fi fi
else local url_fragment=''
issue_arg=${(U)action}
issue="${jira_prefix}${issue_arg}"
fi
local url_fragment
if [[ "$2" == "m" ]]; then if [[ "$2" == "m" ]]; then
url_fragment="#add-comment" url_fragment="#add-comment"
echo "Add comment to issue #$issue" echo "Add comment to issue #$issue"
else else
echo "Opening issue #$issue" echo "Opening issue #$issue"
fi fi
if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
open_command "${jira_url}/issues/${issue}${url_fragment}"
else
open_command "${jira_url}/browse/${issue}${url_fragment}" open_command "${jira_url}/browse/${issue}${url_fragment}"
fi fi
fi
} }
function _jira_url_help() { function _jira_url_help() {

View File

@ -51,13 +51,12 @@ _listInstalledVersions() {
} }
_listInstallableVersions() { _listInstallableVersions() {
# Remove local (+) and installed (*) versions from the list __sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \
__sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[+*] [^ ]\+//g;s/>//g' sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*"
} }
_listAllVersion() { _listAllVersion() {
# Remove (*), (+), and (>) characters from the list __sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g"
__sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[*+>] //g'
} }
_sdk () { _sdk () {

View File

@ -3,7 +3,7 @@ typeset -Ua themes
if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = array && ${#ZSH_THEME_RANDOM_CANDIDATES[@]} -gt 0 ]]; then if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = array && ${#ZSH_THEME_RANDOM_CANDIDATES[@]} -gt 0 ]]; then
# Use ZSH_THEME_RANDOM_CANDIDATES if properly defined # Use ZSH_THEME_RANDOM_CANDIDATES if properly defined
themes=(${(@)ZSH_THEME_RANDOM_CANDIDATES:#random}) themes=($ZSH_THEME_RANDOM_CANDIDATES)
else else
# Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name # Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name
themes=( themes=(
@ -12,7 +12,7 @@ else
"$ZSH"/themes/*.zsh-theme(N:t:r) "$ZSH"/themes/*.zsh-theme(N:t:r)
) )
# Remove blacklisted themes from the list # Remove blacklisted themes from the list
for theme in random ${ZSH_THEME_RANDOM_BLACKLIST[@]}; do for theme in ${ZSH_THEME_RANDOM_BLACKLIST[@]}; do
themes=("${(@)themes:#$theme}") themes=("${(@)themes:#$theme}")
done done
fi fi