Update init command to use new help system

This commit is contained in:
2013-06-02 21:25:19 +03:00
parent 35832165ec
commit ed3fda5769

View File

@@ -2,21 +2,17 @@
set -e set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x [ -n "$TMUXIFIER_DEBUG" ] && set -x
print="" if [ "$1" == "-" ] || [ "$1" == "--help" ]; then
for args in "$@"; do shell="$2"
if [ "$args" = "-" ]; then else
print=1 shell="$1"
shift fi
fi
done
shell="$1"
if [ -z "$shell" ]; then if [ -z "$shell" ]; then
shell="$(basename "$SHELL")" shell="$(basename "$SHELL")"
fi fi
if [ -z "$print" ]; then case "$shell" in
case "$shell" in
bash ) bash )
profile='~/.bash_profile' profile='~/.bash_profile'
;; ;;
@@ -33,17 +29,32 @@ if [ -z "$print" ]; then
profile='~/.tcshrc' profile='~/.tcshrc'
;; ;;
* ) * )
profile='your profile' profile='your shell init file'
;; ;;
esac esac
{ echo "# Load tmuxifier automatically by adding" # Provide tmuxifier help
echo "# the following to ${profile}:" if [[ " $@ " == *" --help "* ]]; then
echo echo "usage: tmuxifier init -
echo "eval \"\$(tmuxifier init -)\""
echo
} >&2
Load Tmuxifier by adding the following to your ${profile}:
eval \"\$(tmuxifier init -)\"
You might also need to add Tmuxifier's bin directory to your PATH."
exit
fi
print=""
for args in "$@"; do
if [ "$args" = "-" ]; then
print=1
shift
fi
done
if [ -z "$print" ]; then
echo "$(tmuxifier-help init $@)" >&2
exit 1 exit 1
fi fi