Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified example.sh
100755 → 100644
Empty file.
Empty file modified functions.sh
100755 → 100644
Empty file.
20 changes: 20 additions & 0 deletions lib/mgmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is how you manage your sessions
# you can create a new sesssion, which will copy the
# example.sh file with a name of your choosing
# and you can edit from there

check_for_project() {
printf 'check: %s\n' "$1"
}

new_project() {
printf 'new: %s\n' "$1"
}

load_project() {
printf 'load: %s\n' "$1"
}

edit_project() {
printf 'edit: %s\n' "$1"
}
7 changes: 7 additions & 0 deletions lib/utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
print_error() {
printf 'ERROR: %s requires a project name.\n' "$1" >&2
}

show_help() {
printf 'Help has arrived!\n'
}
61 changes: 61 additions & 0 deletions shmux
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env sh

. ./lib/utils.sh
. ./lib/mgmt.sh

while :; do
case $1 in
-h | -\? | --help | help)
show_help
exit
;;
check | check_for_project)
if [ -n "$2" ]; then
shift
check_for_project "$@"
else
print_error "$1"
exit 1
fi
;;
new | new_project)
if [ -n "$2" ]; then
shift
new_project "$@"
else
print_error "$1"
exit 1
fi
;;
load | load_project)
if [ -n "$2" ]; then
shift
load_project "$@"
else
print_error "$1"
exit 1
fi
;;
edit | edit_project)
if [ -n "$2" ]; then
shift
edit_project "$@"
else
print_error "$1"
exit 1
fi
;;
--) # End of all options. Passthru additional options to tmux?
shift
break
;;
-?*)
printf 'ERROR: Unknown option: %s\n' "$1" >&2
exit 1
;;
*) # Default case: If no more options then break out of the loop.
break ;;
esac

shift
done