summaryrefslogtreecommitdiff
path: root/help
diff options
context:
space:
mode:
authorGravatar steering72532026-05-18 01:25:46 -0600
committerGravatar steering72532026-05-18 01:25:46 -0600
commitdc54a69b7552d8d44adf25b8009992c4a2b395be (patch)
tree0c1864e9239bf02fc83408be378d983070250ead /help
init
Diffstat (limited to 'help')
-rwxr-xr-xhelp20
1 files changed, 20 insertions, 0 deletions
diff --git a/help b/help
new file mode 100755
index 0000000..47b7e14
--- /dev/null
+++ b/help
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Send help. I'm trapped in the machine.
+
+if [ $# -eq 0 ]; then
+ echo "Commands available:"
+ find -L "$(dirname "$0")" -maxdepth 1 -type f \! -name '.*' -execdir perl -e '$w=80;$buf=""; for (@ARGV) { s@^\./@@; if (length("$buf $_") > $w) { print("$buf\n"); $buf = ""; } $buf .= " $_"; } print("$buf\n");' {} +
+ echo
+ echo "This is https://cgit.space/~cgitspace/git-shell-commands.git@$(git describe --abbrev --dirty)"
+else
+ if [[ $1 == *.* ]]; then
+ echo "No ." >&2
+ exit 1
+ fi
+ if [[ $1 == */* ]]; then
+ echo "No ." >&2
+ exit 1
+ fi
+
+ sed '/^#!/d;/^\([^#]\|$\)/Q;s/^# \?//' "$(dirname "$0")/$1"
+fi