mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +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'
|
'-as'
|
||||||
)
|
)
|
||||||
|
|
||||||
remove_flags() {
|
|
||||||
local regex=$(
|
|
||||||
IFS="|"
|
|
||||||
echo "${_git_commit_flags[*]}"
|
|
||||||
)
|
|
||||||
|
|
||||||
echo $(sed -E "s/\s($regex)\s|\s($regex)$//g" <<<"$1")
|
|
||||||
}
|
|
||||||
|
|
||||||
build_message() {
|
build_message() {
|
||||||
local argv=("$@")
|
local argv=("$@")
|
||||||
local argc=${#@}
|
local argc=${#@}
|
||||||
local i=1
|
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
|
while [[ $i -lt $argc ]]; do
|
||||||
local flag="${argv[$i]}"
|
local flag="${argv[$i]}"
|
||||||
local value="${argv[$i + 1]}"
|
local value="${argv[$i + 1]}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue