Skip to content

Commit 5e60de8

Browse files
committed
Print local info quickly
1 parent 6f3b8df commit 5e60de8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

bin/cppsm

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,28 @@ if [ "$UPGRADE" = 1 ]; then
1515
exec git -C "$CPPSM" pull "${GIT_QUIET[@]}" --rebase
1616
fi
1717

18+
# shellcheck disable=SC2035
19+
COMMANDS="$(cd "$CPPSM/commands" && echo *)"
20+
COMMANDS="${COMMANDS// /|}"
21+
1822
BRANCH="$(git -C "$CPPSM" symbolic-ref --short HEAD)"
1923

24+
cat << EOF
25+
Usage: ${0##*/} [$COMMANDS]
26+
27+
Run any command with --help to see a brief description of the command.
28+
29+
Visit https://cppsm.github.io/ for full documentation.
30+
31+
Branch: $BRANCH
32+
$(git -C "$CPPSM" log -n 5 --pretty=oneline --abbrev-commit | sed 's#^# #g')
33+
EOF
34+
2035
git -C "$CPPSM" fetch "${GIT_QUIET[@]}" origin "$BRANCH"
2136

2237
ORIGIN="$(git -C "$CPPSM" log --pretty=oneline --abbrev-commit "..origin/$BRANCH" | sed 's#^# #g')"
2338
if [ -n "$ORIGIN" ]; then
24-
ORIGIN="$(cat << EOF
39+
cat << EOF
2540
2641
Origin:
2742
$ORIGIN
@@ -32,21 +47,6 @@ Run
3247
3348
to upgrade cppsm.
3449
EOF
35-
)"
3650
fi
3751

38-
# shellcheck disable=SC2035
39-
COMMANDS="$(cd "$CPPSM/commands" && echo *)"
40-
COMMANDS="${COMMANDS// /|}"
41-
cat << EOF
42-
Usage: ${0##*/} [$COMMANDS]
43-
44-
Run any command with --help to see a brief description of the command.
45-
46-
Visit https://cppsm.github.io/ for full documentation.
47-
48-
Branch: $BRANCH
49-
$(git -C "$CPPSM" log -n 5 --pretty=oneline --abbrev-commit | sed 's#^# #g')
50-
$ORIGIN
51-
EOF
5252
exit 1

0 commit comments

Comments
 (0)