Improve argument handling of init command

This commit is contained in:
2013-06-03 09:16:58 +03:00
parent 4d486d48d0
commit 1a9dd4787d

View File

@@ -2,11 +2,12 @@
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
if [ "$1" == "-" ] || [ "$1" == "--help" ]; then
shell="$2"
else
shell="$1"
fi
# Set shell to first argument that is not "-" or "--help".
for arg in "$@"; do
if [ "$arg" != "-" ] && [ "$arg" != "--help" ]; then
shell="$arg"
fi
done
if [ -z "$shell" ]; then
shell="$(basename "$SHELL")"