aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtimelog12
1 files changed, 8 insertions, 4 deletions
diff --git a/timelog b/timelog
index 4dbbbc6..f3f753d 100755
--- a/timelog
+++ b/timelog
@@ -21,9 +21,9 @@ EDITOR=${EDITOR:=vi}
# http://stackoverflow.com/questions/899609/gnu-screen-run-script-that-sends-commands-to-the-screen-session-it-is-being-run
function timelog_window_title {
if [ -n "$STY" ]; then
- screen -p $WINDOW -X title $1
+ screen -p $WINDOW -X title "$*"
else
- xtitle $1
+ xtitle "$*"
fi
}
@@ -79,21 +79,25 @@ function timelog_menu {
exit 1
fi
else
- echo "Usage: $BASENAME <group> [edit]"
+ echo "Usage: $BASENAME [group] [edit]"
exit 1
fi
}
-# Run
+# Run worklog for a given project
function timelog_run {
+ # Set window title
timelog_window_title "log: $GROUP"
+ # Set base folder
if [ -d "$CODE/$GROUP" ] && [ ! -d "$BASE/$GROUP" ]; then
BASE="$CODE"
fi
+ # Ensure folder exist
mkdir -p $BASE/$GROUP/worklog
+ # Run
if [ ! -e "$BASE/$GROUP/worklog/projects" ]; then
timelog_setup
elif [ "$ACTION" == "edit" ]; then