summaryrefslogtreecommitdiff
path: root/help
diff options
context:
space:
mode:
authorGravatar steering72532026-05-18 01:51:49 -0600
committerGravatar steering72532026-05-18 01:51:49 -0600
commitb2d18b25aa4a0d5dfa18c3b69f99cba58a656e68 (patch)
tree79f291887e92d06cb5f3b1b765c7a196351cea26 /help
parentinit (diff)
add version and set term title
Diffstat (limited to 'help')
-rwxr-xr-xhelp11
1 files changed, 9 insertions, 2 deletions
diff --git a/help b/help
index 47b7e14..13dc75e 100755
--- a/help
+++ b/help
@@ -1,11 +1,18 @@
#!/bin/sh
# Send help. I'm trapped in the machine.
+echo -e "\e]0;$USER@$HOSTNAME\e\\"
+
+cd "$(dirname "$0")"
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");' {} +
+ find -L . -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)"
+ status=""
+ git diff --no-ext-diff --quiet || status="${status}*"
+ git diff --no-ext-diff --cached --quiet || status="${status}+"
+ git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null && status="${status}%"
+ echo -e "This is \e]8;;https://cgit.space/~cgitspace/git-shell-commands/.git/tree/?id=$(git rev-parse HEAD)\e\\https://cgit.space/~cgitspace/git-shell-commands.git\e]8;;\e\\@$(git describe --long --always)$status"
else
if [[ $1 == *.* ]]; then
echo "No ." >&2