diff options
author | Parabola git <git@parabola.nu> | 2016-07-08 01:50:36 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2016-07-08 01:50:36 +0000 |
commit | d757e49a4042b3659c906a2bb404abd6e9eb853f (patch) | |
tree | 1f2f301e1272485935b0c5cff190bf83aba96619 /git-shell-commands | |
parent | df6c05258268304f9c2d96d34e038cebfc7950d2 (diff) |
improve "help" text
Diffstat (limited to 'git-shell-commands')
-rwxr-xr-x | git-shell-commands/change-description | 6 | ||||
-rwxr-xr-x | git-shell-commands/change-owner | 6 | ||||
-rwxr-xr-x | git-shell-commands/create-bare-repo | 6 | ||||
-rwxr-xr-x | git-shell-commands/delete-repo | 6 | ||||
-rwxr-xr-x | git-shell-commands/help | 29 |
5 files changed, 36 insertions, 17 deletions
diff --git a/git-shell-commands/change-description b/git-shell-commands/change-description index 16b7ad2..cb22171 100755 --- a/git-shell-commands/change-description +++ b/git-shell-commands/change-description @@ -1,7 +1,7 @@ #!/bin/bash -# * change-description -# Change the project description, needs "description" in the project -# ssh git@host change-description repo "description" +# * change-description REPO DESCRIPTION +# Change the project description +# Example: change-description packages/libretools "Tools for working on Parabola" set -e diff --git a/git-shell-commands/change-owner b/git-shell-commands/change-owner index 8b59388..2b6f6ac 100755 --- a/git-shell-commands/change-owner +++ b/git-shell-commands/change-owner @@ -1,7 +1,7 @@ #!/bin/bash -# * change-owner -# Change the owner project -# ssh git@host change-owner repo "Hacklab" +# * change-owner REPO OWNER +# Change the project owner +# Example: change-owner packages/libretools "Luke Shumaker" set -e diff --git a/git-shell-commands/create-bare-repo b/git-shell-commands/create-bare-repo index 817ac1b..4cc63cd 100755 --- a/git-shell-commands/create-bare-repo +++ b/git-shell-commands/create-bare-repo @@ -1,7 +1,7 @@ #!/bin/bash -# * create-bare-repo -# Allows users to create repo.git -# ssh git@host create-bare-repo repo1 repo2 ... +# * create-bare-repo REPO [REPO2...] +# Allows users to create REPO.git +# Example: create-bare-repo packages/libretools packages/pbs-tools set -e diff --git a/git-shell-commands/delete-repo b/git-shell-commands/delete-repo index 41b1d76..04e896b 100755 --- a/git-shell-commands/delete-repo +++ b/git-shell-commands/delete-repo @@ -1,7 +1,7 @@ #!/bin/bash -# * delete-repo -# Allows users to delete repositories permanently -# ssh git@host delete-repo repo1 repo2 ... +# * delete-repo REPO [REPO2...] +# Allows users to delete REPO.git permanently +# Example: delete-repo packages/libretools packages/pbs-tools set -e diff --git a/git-shell-commands/help b/git-shell-commands/help index f2970d5..0792cb5 100755 --- a/git-shell-commands/help +++ b/git-shell-commands/help @@ -1,12 +1,31 @@ -#!/bin/sh -# * help +#!/usr/bin/env bash +# * help [COMMAND] # Get enabled commands -# ssh git@host help +# Example: help +# Example: help create-bare-repo set -e +HOSTNAME=git.parabola.nu + +if [[ "$*" = */* ]]; then + printf 'Command names may not contain /\n' + exit 1 +fi + +if test $# = 0; then + cmds=("$(dirname "$0")"/*) +else + cmds=("${@/#/"$(dirname "$0")/"}") +fi + # Gets the initial comment after the shebeng from every git-shell-command -for c in "$(dirname "$0")"/*; do +for c in "${cmds[@]}"; do sed -rn '2,/^[^#]/s/^# ?//p' "$c" echo -done +done | +if test -z "$TERM" || test "$TERM" = dumb; then + sed "s/Example: /&ssh $USER@$HOSTNAME /" +else + cat +fi |