mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
feat: "remove_flags" only used in the scope of "build_message"
This commit is contained in:
parent
701cb644dd
commit
5061f0d7eb
1 changed files with 9 additions and 9 deletions
|
|
@ -24,20 +24,20 @@ _git_commit_flags=(
|
|||
'-as'
|
||||
)
|
||||
|
||||
remove_flags() {
|
||||
local regex=$(
|
||||
IFS="|"
|
||||
echo "${_git_commit_flags[*]}"
|
||||
)
|
||||
|
||||
echo $(sed -E "s/\s($regex)\s|\s($regex)$//g" <<<"$1")
|
||||
}
|
||||
|
||||
build_message() {
|
||||
local argv=("$@")
|
||||
local argc=${#@}
|
||||
local i=1
|
||||
|
||||
remove_flags() {
|
||||
local regex=$(
|
||||
IFS="|"
|
||||
echo "${_git_commit_flags[*]}"
|
||||
)
|
||||
|
||||
echo $(sed -E "s/\s($regex)\s|\s($regex)$//g" <<<"$1")
|
||||
}
|
||||
|
||||
while [[ $i -lt $argc ]]; do
|
||||
local flag="${argv[$i]}"
|
||||
local value="${argv[$i + 1]}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue