mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
fix: remove flags automatically
This commit is contained in:
parent
ffcf44621e
commit
52ef4ad669
1 changed files with 1 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ remove_flags() {
|
||||||
local message="$1"
|
local message="$1"
|
||||||
local flags=("${@:2}")
|
local flags=("${@:2}")
|
||||||
|
|
||||||
local regex=$(IFS="|"; echo "${flags[*]}")
|
local regex=$(IFS="|"; echo "${_git_commit_flags[*]}")
|
||||||
|
|
||||||
message=$(sed -E "s/\s($regex)\s|\s($regex)$//g" <<< "$message")
|
message=$(sed -E "s/\s($regex)\s|\s($regex)$//g" <<< "$message")
|
||||||
|
|
||||||
|
|
@ -38,23 +38,18 @@ build_message () {
|
||||||
if [[ "$*" =~ (-sa|-as) ]]; then
|
if [[ "$*" =~ (-sa|-as) ]]; then
|
||||||
local attention='!'
|
local attention='!'
|
||||||
local scope="($2)"
|
local scope="($2)"
|
||||||
shift 2
|
|
||||||
elif [[ "$1" =~ (-a|--attention) ]]; then
|
elif [[ "$1" =~ (-a|--attention) ]]; then
|
||||||
local attention='!'
|
local attention='!'
|
||||||
shift 1
|
|
||||||
elif [[ "$2" =~ (-a|--attention) ]]; then
|
elif [[ "$2" =~ (-a|--attention) ]]; then
|
||||||
local attention='!'
|
local attention='!'
|
||||||
shift 1
|
|
||||||
elif [[ "$*" =~ (-a|--attention) ]]; then
|
elif [[ "$*" =~ (-a|--attention) ]]; then
|
||||||
local attention='!'
|
local attention='!'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$*" =~ (-s|--scope) ]]; then
|
if [[ "$*" =~ (-s|--scope) ]]; then
|
||||||
local scope="($2)"
|
local scope="($2)"
|
||||||
shift 2
|
|
||||||
elif [[ "$2" =~ (-s|--scope) ]]; then
|
elif [[ "$2" =~ (-s|--scope) ]]; then
|
||||||
local scope="($3)"
|
local scope="($3)"
|
||||||
shift 2
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local message="'$type'${scope}$attention: $@";
|
local message="'$type'${scope}$attention: $@";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue