Skip to content

Commit b5b0632

Browse files
committed
Removes use of sed.
1 parent 95e8832 commit b5b0632

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/git-split-file.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
## - <split-strategy> is the strategy that should be applied to the source-file
3535
## Can be one of DELETE | KEEP | MOVE
3636
##
37-
## Call --help for more details
38-
##
3937
#/ Usually when you want to split a file into several files under git, you would
4038
#/ loose the git history of this file. Often this is not desirable. The goal of
4139
#/ this script is to enable splitting one file under Git revision control into
@@ -196,10 +194,8 @@ printTopic() {
196194
# Displays all lines in main script that start with '##'
197195
# ------------------------------------------------------------------------------
198196
shortUsage() {
199-
# shellcheck disable=SC2086
200-
[ "$*" ] && echo "$(basename $0): $*"
201-
sed -n '/^##/,/^$/s/^## \{0,1\}//p' "$0"
202-
} #2>/dev/null
197+
grep '^##' <"$0" | cut -c4-
198+
}
203199
# ==============================================================================
204200

205201

@@ -610,7 +606,9 @@ finish() {
610606
printErrorMessages "${g_aErrorMessages[*]}"
611607

612608
if [[ ${g_iExitCode} -eq 65 ]];then
613-
shortUsage "${@}"
609+
shortUsage
610+
echo 'Call --help for more details'
611+
614612
fi
615613
fi
616614

0 commit comments

Comments
 (0)