Skip to content

Commit d989d9c

Browse files
author
CI script
committed
Show help with no arguments and show more of it
1 parent 623fce4 commit d989d9c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bin/cppsm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44
. "${BASH_SOURCE%/*/*}/commands/.settings"
55

66
COMMAND="$CPPSM/commands/$1"
7-
shift
87

9-
if [ ! -x "$COMMAND" ]; then
8+
if [ $# = 0 ] || [ ! -x "$COMMAND" ]; then
109
# shellcheck disable=SC2035
1110
COMMANDS="$(cd "$CPPSM/commands" && echo *)"
1211
COMMANDS="${COMMANDS// /|}"
1312
cat << EOF
1413
Usage: ${0##*/} [$COMMANDS]
14+
15+
Run any command with --help to see a brief description of the command.
16+
17+
Visit https://cppsm.github.io/ for full documentation.
18+
19+
Branch: $(git -C "$CPPSM" symbolic-ref --short HEAD)
20+
$(git -C "$CPPSM" log -n 5 --pretty=oneline --abbrev-commit | sed 's#^# #g')
21+
1522
EOF
1623
exit 1
1724
fi
1825

26+
shift
1927
"$COMMAND" "$@"

0 commit comments

Comments
 (0)