Add version and basic help information

This commit is contained in:
2012-04-22 11:52:52 +01:00
parent ed8743facb
commit 5b73edcead
3 changed files with 43 additions and 2 deletions

View File

@@ -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

31
libexec/tmuxifier-help Executable file
View File

@@ -0,0 +1,31 @@
#! /usr/bin/env bash
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
case $1 in
"" )
echo "Usage: tmuxifier <command> [<args>]
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 <command>' 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

5
libexec/tmuxifier-version Executable file
View File

@@ -0,0 +1,5 @@
#! /usr/bin/env bash
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
echo "0.0.1"