diff --git a/bin/tmuxifier b/bin/tmuxifier index 2cfaf33..60ea355 100755 --- a/bin/tmuxifier +++ b/bin/tmuxifier @@ -15,9 +15,14 @@ export PATH="$TMUXIFIER/libexec:$PATH" command="$1" case "$command" in - "" | "-h" | "--help" | "help" ) - echo "[ put help message here ]" + "" | "-h" | "--help" ) + echo -e "tmuxifier $(tmuxifier-version)\n$(tmuxifier-help)" >&2 ;; + + "-v" | "--version" ) + tmuxifier-version + ;; + * ) command_path="$(command -v "tmuxifier-$command" || true)" if [ -z $command_path ]; then diff --git a/libexec/tmuxifier-help b/libexec/tmuxifier-help new file mode 100755 index 0000000..44fbe47 --- /dev/null +++ b/libexec/tmuxifier-help @@ -0,0 +1,31 @@ +#! /usr/bin/env bash +set -e +[ -n "$TMUXIFIER_DEBUG" ] && set -x + +case $1 in + "" ) + echo "Usage: tmuxifier [] + +Some useful tmuxifier commands are: + session Load the specified session layout. + window Load the specified window layout into current session. + list List all session and window layouts. + list-sessions List session layouts. + list-windows List window layouts. + commands List all tmuxifier commands. + +See 'tmuxifier help ' for information on a specific command." + ;; + * ) + command_path="$(command -v "tmuxifier-$1" || true)" + if [ -n "$command_path" ]; then + echo "Sorry, the \`$1' command isn't documented yet." + echo + echo "You can view the command's source here:" + echo "$command_path" + echo + else + echo "tmuxifier: no such command \`$1'" + fi + ;; +esac diff --git a/libexec/tmuxifier-version b/libexec/tmuxifier-version new file mode 100755 index 0000000..646517f --- /dev/null +++ b/libexec/tmuxifier-version @@ -0,0 +1,5 @@ +#! /usr/bin/env bash +set -e +[ -n "$TMUXIFIER_DEBUG" ] && set -x + +echo "0.0.1"